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 to the <DoptProvider /> along with the API key for your environment (see ProviderConfig). 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 0. This allows you to directly access the uncommitted version on your flow builder canvas:

{ 'new-user-onboarding': 0 }

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 'https://blocks.dopt.com/v2/flow/new-user-onboarding/reset?userIdentifier=123456789&version=1' \
-X POST \
-H 'x-api-key:$YOUR_BLOCKS_API_KEY'
info

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