Skip to content

Connecting Basin

The plugin talks to Basin with an Account API key, and shows the forms from one Basin project.

In Basin, go to Account → API and create an Account API key.

Add the key to your .env file. Do the same on every environment (staging, production) where the plugin runs.

.env
BASIN_API_KEY="your-account-api-key"

The plugin only accepts an environment variable here, never the key itself, so the key can’t end up in project config or version control.

  1. Go to Basin → Settings (or Settings → Plugins → Basin).
  2. Under Account API key, enter $BASIN_API_KEY.

The plugin checks the key as soon as you enter it, and says if it doesn’t work. You can check it again at any time with Test connection.

Once the key works, Basin project lists your projects, with each one’s ID. Choose the one whose forms this site uses, and save.

Every form in that project is now available to the site. There’s nothing to turn on per form: to make a form available, put it in the project in Basin; to remove it, move it out.

The project setting also accepts an environment variable. That’s useful when staging posts to a “Client – Staging” project and production to the live one:

.env
BASIN_PROJECT_ID="12345"

$BASIN_PROJECT_ID is then listed under Environment Variables in Basin project, beside the name of the project it holds. Choose it, and save. Only variables that hold one of your project IDs are listed.

You can change the project at any time. Nothing is copied or deleted: the site simply uses the new project’s forms from then on.

  • Basin → Forms and the submissions screens show the new project’s forms. Links to the old project’s forms stop working.
  • Templates and Basin Form fields that use a form from the old project no longer show it, and each one is listed in the error log.
  • Each form’s settings on this site (its Form Studio embed code and reCAPTCHA version) are kept for 30 days, so if you switch back within that time, everything works as before.