Introduction
Although Prelude can generate a code for you, you can also generate your own custom OTP. This is useful when:- You use a multiprovider setup where you recognize which provider converted the user.
- You want to integrate Prelude effortlesly with an existing authentication flow.
- Use alphanumeric characters in the code (subject to Prelude’s approval).
To enable the custom code feature on your account, you need to contact our support team.
options.code_size
parameter on the POST /v2/verification
endpoint.
How to use custom codes in your verification flow
To use a custom code for your verification flow, you need to set thecustom_code
parameter to the code you want to use on the POST /v2/verification
endpoint.
The custom code needs to be a string of 4 to 8 numeric characters.
The custom code you want to use. The code needs to be a string of 4 to 8 numeric characters.
Caveats
To ensure optimal performance:- Ensure that you are sending a different custom code for each verification request/retry.
- Ensure that you are always sending the
POST /v2/verification/check
request to verify the code when the user enters the code.
Prelude uses the custom code to identify which provider converted the user. If you send the same custom code for multiple verification requests, Prelude will not be able to identify which provider converted the user and will not be able to attribute the conversion to a specific provider and thus optimize the routing algorithm for your account. You can read more about the multi-routing system here.