Sign-up with application invitations
When a user visits an invitation link, and no custom redirect URL was specified, then they will be redirected to Clerk's Account Portal sign-up page and their email address will be automatically verified.
However, if you specified a redirect URL when creating the invitation, you must handle the sign-up flow in your code for that page. You can either embed Clerk's <SignUp />
component on that page, or if the prebuilt component doesn't meet your specific needs or if you require more control over the logic, you can rebuild the existing Clerk flows using the Clerk API.
This guide will demonstrate how to build a custom sign-up flow to handle application invitations.
Create the sign-up flow
Once the user visits the invitation link and is redirected to the specified URL, the query parameter __clerk_ticket
will be appended to the URL. This query parameter contains the invitation token.
For example, if the redirect URL was https://www.example.com/accept-invitation
, the URL that the user would be redirected to would be https://www.example.com/accept-invitation?__clerk_ticket=.....
.
To create a sign-up flow using the invitation token, you need to extract the token from the URL and pass it to the signUp.create()
method, as shown in the following example. The following example also demonstrates how to collect additional user information for the sign-up; you can either remove these fields or adjust them to fit your application.
Feedback
Last updated on