import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.users.checkAccess('resource_id', { id: 'user_xxxxxxxxxxxxx' });
console.log(response.access_level);{
"has_access": true
}Check whether a user has access to a specific resource, and return their access level.
import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const response = await client.users.checkAccess('resource_id', { id: 'user_xxxxxxxxxxxxx' });
console.log(response.access_level);{
"has_access": true
}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.
A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
The unique identifier or username of the user.
"user_xxxxxxxxxxxxx"
The unique identifier of the resource to check access for. Accepts a company, product, or experience identifier.
Was this page helpful?