This operation is only available on the server.
import { whopApi } from "@/lib/whop-api";

const result = await whopApi.access.checkIfUserHasAccessToAccessPass({
	// The ID of the access pass
	accessPassId: "prod_XXXXXXXX" /* Required! */,

	// The ID of the user
	userId: "user_XXXXXXXX",
});

Example output:

const response = {
	// Whether the user has access to the resource
	hasAccess: true,

	// The permission level of the user
	accessLevel: "admin" /* Valid values: admin | customer | no_access */,
};