This function and all other functions in this graphql sdk are deprecated. Please migrate to the new rest api.
This operation is only available on the server.
Usage
Copy
Ask AI
import { whopSdk } from "@/lib/whop-sdk";
const result = await whopSdk.access.checkIfUserHasAccessToCompany({
// The ID of the company
companyId: "biz_XXXXXXXX" /* Required! */,
// The ID of the user
userId: "user_XXXXXXXX",
});
Example output
Copy
Ask AI
const result = {
// Whether the user has access to the resource
hasAccess: true,
// The permission level of the user
accessLevel: "admin" /* Valid values: admin | customer | no_access */,
};

