Customize designs with code
Design
You can only preview custom code if you are on a Kinde Plus or Scale plan.
Unlike changes you make in the Kinde UI that impact page layouts and content, your custom designs can’t be viewed in a Kinde-generated preview.
Instead, you can test designs using your real auth flow, using preview credentials.
Before you can preview your custom code, you need to connect your code repository to Kinde and enable the preview feature:
To securely preview your changes, the authentication request must contain a valid Preview Session ID (psid). Because of this requirement, you should not manually construct or append parameters to the URL. Instead, you must use a Kinde SDK or library to generate the URL for you.
In your application code, pass the appropriate preview mode parameter to your SDK’s login function or component to initiate the preview flow.
Example using the Kinde React SDK:
<LoginLink className="btn btn-ghost sign-in-btn" pagesMode="preview"> Login</LoginLink>The SDK will automatically generate a secure URL with a valid session ID. The resulting URL format will look like this:
{kinde_subdomain}/auth/cx/_:nav&m:pages_preview_authorization&psid:{preview_session_ID}
When you initiate the auth flow via your application, you will be redirected to a password screen.
To access the preview, go to Design > Custom code > Preview in your Kinde dashboard.
Copy the Password provided there and enter it into the authentication screen.
The preview will now show your latest custom code deployment.