Quickstart
Create an API key
Create an API key in the Whop Developer Dashboard and save it on your server as WHOP_API_KEY.
This key will allow you to perform actions within the context of your company. Keep it on the server. Never put it in browser, mobile, or client-side code.
Install packages
Install the SDK in your backend:
Next.js
Express
cURL
Install the elements packages in your frontend:
React
HTML
iOS
Get a user ID for your users
Enroll your own users as connected accounts before minting chat tokens. This creates a Whop account you can map back to your platform user.
Next.js
Express
cURL
Save the resulting Whop user ID (owner_user.id in the response) on your side and pass it as user_id when you create chat access tokens.
See company-specific profiles for more details on how to update users avatars and display names.
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.
Next.js
Express
cURL
Create or fetch a channel, DM, or support chat
All chat types use real-time messaging and can render in the Chat element. Pick the type based on your needs:
Before rendering chat, get the channel ID you want to open.
- Channels IDs start with
chat_feed_. - DMs and support chats IDs start with
feed_.
Render chat in your app
This will use the token endpoint you created to fetch a token and render the chat element. The SDK is responsible of managing the token and refreshing it when necessary.

