Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.whop.com/llms.txt

Use this file to discover all available pages before exploring further.

Sync users before you mint company-scoped user tokens for embedded chat. The user you pass as user_id must exist on Whop, and you can set a company-specific name and profile picture that appears for that user in chat.
This is not needed for OAuth. If you use OAuth, the user signs in to Whop and the OAuth token identifies their Whop account.

1. Enroll users as connected accounts

Create a connected account for each user on your platform. This is the same flow used by the payouts SDK — see the Enroll connected accounts guide for the full walkthrough.
import Whop from "@whop/sdk";

const client = new Whop({ apiKey: process.env.WHOP_API_KEY });

const company = await client.companies.create({
  email: "user@example.com",
  parent_company_id: "biz_XXXXXXXXXXXXX", // your platform's company ID
  title: "Jane Doe",
  metadata: {
    internal_user_id: "user_12345", // your platform's user ID
  },
});
Save the resulting user ID on your side — you’ll pass it when minting company-scoped chat tokens.

2. Set a company-specific name and profile picture

Call the Update user endpoint with your company ID to set overrides shown for that user in the context of your company. Without a company ID, the fields update the user’s global profile instead. Avatars are uploaded via the Create file endpoint — pass the returned file ID as the profile picture. Call this whenever a user’s profile changes on your platform so Whop stays in sync.
The Update user endpoint requires the user:profile:update permission on the API key making the request. Use a company API key with owner-level access, or a key that includes the user:profile:update scope.

Next steps

Authentication

Mint company-scoped user tokens for embedded chat.

OAuth

Use Whop sign-in instead of syncing users yourself.

Chat element

Render a live chat UI once your users are authenticated.

Enroll connected accounts

Learn the full connected-account enrollment flow.