Environments and versions
Userflow makes it easy to manage the different versions of your content as well as to test it in different environments. Environments and version control are powerful features of Userflow and allow you to test and improve your flows in an easy and non-risky fashion.
Each environment has a separate Userflow.js token, which completely isolates your staging users from your production users. It also means that you can change and try out flows in your staging environment without impacting the flow currently published in production.
Adding a new environment
To set up a new environment:
- Go to Settings → Environments.
- Click Create new environment and give it a name, such as “Staging”.
- A new Userflow.js token will be generated. Use this token in your Userflow.js snippet in your staging environment. Read more in the Userflow.js installation guide.
Now that you have two or more environments installed, you can easily manage where you publish your content. To make this even easier, Userflow offers easy-to-use version control.
Under a flow’s Versions tab you’ll see:
- Version history, listing all your previous versions. Userflow automatically creates new versions periodically, when you publish, or if multiple users edit the same flow.
- Publish history, showing a log of when flows were published and by who.
By clicking on the 3 dots to the right of each version, you can:
- View its content as it were in the Builder in read-only mode.
- Compare 2 versions, which lets you inspect changes between 2 versions.
- Publish it, for example, to revert to a previous version.
- Restore it in case you want to undo some changes you’ve made.
Publish to a single environment
Once you have installed the Userflow.js snippet in your environment, you can publish content to it.
- Go to a specific flow
- Click Publish
- A screen appears showing what changes you have made since the last version was published
- Deselect Production
- Click Publish to Staging
You can always keep track of which version you have deployed to which environment through the Versions tab and restore to the production version if needed.
Unpublish from an environment
If you have published something by mistake, you can always unpublish it via the following steps:
- Go to the Versions tab under a flow
- Click on the 3 dots next to the environment you want to unpublish from
- Click Unpublish
The same menu can also be used to publish the latest version of a flow.