Expose registration from a route
A web application needs a dedicated sign-up entry point.
Kinde · Module
The Kinde TypeScript SDK register method creates a redirect URL for hosted user sign-up. Expose it through an application route and redirect the browser to the returned URL.
The register method creates a redirect URL for Kinde's hosted sign-up flow. A web route calls it with the session manager, then redirects the browser so the user can register before returning to the application.
kindeClient.register(sessionManager)| Name | Type | Description |
|---|---|---|
sessionManager | SessionManager | The application's session manager used by the TypeScript SDK while creating the registration redirect. |
A redirect URL pointing to Kinde's hosted sign-up flow.
app.get("/register", async (req, res) => {
const registerUrl = await kindeClient.register(sessionManager);
res.redirect(registerUrl.toString());
});Creates a registration route that obtains Kinde's sign-up redirect URL and sends the browser there.
A web application needs a dedicated sign-up entry point.
An application uses Kinde's hosted authentication pages.
A UI link should begin account creation without embedding authentication forms.
It constructs a redirect URL for Kinde's hosted sign-up experience. The application then redirects the user's browser to that URL.
Follow-up: How would you expose it in an Express application? Add a GET /register route, await kindeClient.register(sessionManager), and redirect to the returned URL.
The TypeScript SDK usage passes the session manager to register. The returned URL is converted to a string before it is supplied to the response redirect.
Follow-up: Why pass the session manager? It lets the SDK use the application's session handling while preparing the authentication redirect.
Create a route such as /register and call the SDK method from that route. The browser must be redirected to Kinde, where the user completes sign-up.
Follow-up: What should be configured before testing? The application needs a Kinde domain and the relevant authentication callback configuration.
loginsessionManagerKindeClientauthentication callback