Skip to main content

Whop's credential types

See Auth & API keys for all four Whop credential types, when to use each, and how to scope a token down to the actions it needs.
Before using the chat SDK, you need to authenticate users. Pick one of two approaches:

Account-scoped user tokens

Use this approach if your app already has its own users (via your own auth / session system). You keep your existing login flow and mint a Whop token for whichever user is currently signed in — no extra sign-in step. Your server exchanges your Whop API key for a short-lived user token on demand and returns it to the client. You decide which user the token is for.

1. Gather your credentials

You’ll need three things:
  1. API key — create one at the Whop Developer Dashboard. Treat it like a password and keep it on your server only.
  2. Account ID. Find it in your dashboard URL: whop.com/dashboard/biz_XXXXXXXXX/.
  3. User ID — the user you want to authenticate. In production, derive this from your own auth / session system.
For embedded chat, both account_id and user_id are required together when minting a token.

2. Create a token endpoint on your server

Add an endpoint that calls POST https://api.whop.com/api/v1/access_tokens with your API key and returns the resulting token to the client.
app/api/chat/token/route.ts

3. Fetch the token from your app

On web, fetch a token from your endpoint and pass it as accessToken. On iOS, give the SDK a token provider and it fetches a new token whenever it needs one.

Required scopes

Request these scopes when creating the token:
If your app owns the user accounts and mints account-scoped chat tokens, sync those users before passing their user_id here. User syncing isn’t part of OAuth.

Sync your users

Create or map Whop users before minting account-scoped chat tokens.

OAuth

OAuth lives on its own page so this guide can stay focused on account-scoped user tokens. Use OAuth when your app wants users to sign in to Whop themselves through a sign-in page or iOS webview. This is the right choice when your app needs access to a user-owned Whop account, or when you don’t want your backend to mint Whop user tokens.

OAuth

Set up OAuth scopes, redirect URIs, web token endpoints, and SDK-managed OAuth on iOS.