Adding Sign in with Whop

If you would like to give your users a better experience, add a way for them to authenticate if they originally purchased from Whop. First, you will need to send your users to the Whop OAuth Portal. You can do this by having the user click a login button, which might look something like this:

<a
  href={`https://whop.com/oauth?client_id=${process.env.CLIENT_ID}&redirect_uri=${process.env.REDIRECT_URI}`}
>
  <button>Login with Whop</button>
</a>

To get your Client ID, head to the Whop Developer Settings page.

After being redirected, the user will be prompted to sign in with their existing Whop account, or create a new one.

Redirect URL

After the user has signed in, they will be redirected to the URL you specified in the redirect_uri query parameter. The URL will also contain a code query parameter, which you can use to get the user’s access token.

To learn how to setup a callback URL, follow this guide

Was this page helpful?