Skip to main content

Testing flows

You can test against Dopt directly by identifying test users and configuring the Dopt SDK with their userId. We recommend testing against your development environment to keep your test user data and state separate from production user data and state.

After you've identified your test user, you can provide their userId along with the API key for your environment to the SDK. Check out the React, Vue, and JavaScript SDK configs for more details.

You can then access and update this user's state in your app as you develop and test your flow.

As you develop your flow, you may want to test without having to continuously commit new versions. You can do this by specifying a version of "uncommitted" or 0 which will point to the uncommitted version:

{ 'new-user-onboarding': 'uncommitted' }

If you'd like to reset your user's state, you can do that from the users page.

We also provide an endpoint to reset the state of the flow for the user you are testing with. Assuming the user identified earlier (i.e. user 123456789), a flow with identifier new-user-onboarding, and version 1:

curl "" \
-H "x-api-key:$YOUR_BLOCKS_API_KEY" \
-H "Content-Type: application/json" \
-d "{}"

The flow identifier is listed on the flows page underneath each flow name.