import { app, company, me } from "./api"; import { lastActivity } from "./last-activity"; import { notifications } from "./notifications"; import type { webhooks } from "./schema"; /** * # SDK wrapping the Whop API * * It supports 3 modes: `me`, `company` and `app`. * * ## Me Mode * Use "me" mode to make requests on behalf of a user. * * You must provide a valid user JWT token. You can do this by passing it * directly as a string, or by passing a headers or request object from which * the SDK can extract from the incoming cookie header. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const me = await WhopAPI.me({ req }).GET("/me", {}); * return me; * } * ``` * * ## App Mode * Use "app" mode to make requests on behalf of the app using your api key. * * You may provide your api, by default the SDK will look for it in the * `WHOP_API_KEY` environment variable. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const user = await WhopAPI.app().GET("/app/users/{id}", { params: { path: { id: "user_XXXXXX" } } }); * return user; * } * ``` * * ## Company Mode * Use "company" mode to make requests on behalf of your company using your api key. * * You may provide your api, by default the SDK will look for it in the * `WHOP_COMPANY_API_KEY` environment variable. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const user = await WhopAPI.company().GET("/company/users/{id}", { params: { path: { id: "user_XXXXXX" } } }); * return user; * } * ``` */ export declare const WhopAPI: { GET

(url: P, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; PUT(url: P_1, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; POST(url: P_2, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; DELETE(url: P_3, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; OPTIONS(url: P_4, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; HEAD(url: P_5, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; PATCH(url: P_6, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; TRACE(url: P_7, init: import("@whop-apps/typed-api/dist/rest/type-helpers").MakeObjectsWithoutRequiredKeysOptional>>): Promise>; /** * ## Me Mode * Use "me" mode to make requests on behalf of a user. * * You must provide a valid user JWT token. You can do this by passing it * directly as a string, or by passing a headers or request object from which * the SDK can extract from the incoming cookie header. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const me = await WhopAPI.me({ req }).GET("/me", {}); * return me; * } * ``` */ me: typeof me; /** * ## App Mode * Use "app" mode to make requests on behalf of the app using your api key. * * You may provide your api, by default the SDK will look for it in the * `WHOP_API_KEY` environment variable. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const user = await WhopAPI.app().GET("/app/users/{id}", { params: { path: { id: "user_XXXXXX" } } }); * return user; * } * ``` */ app: typeof app; /** * ## Company Mode * Use "company" mode to make requests on behalf of your company using your api key. * * You may provide your api, by default the SDK will look for it in the * `WHOP_COMPANY_API_KEY` environment variable. * * ```ts * import { WhopAPI } from '@whop-apps/api'; * * export const GET = async (req: NextRequest) => { * const user = await WhopAPI.company().GET("/company/users/{id}", { params: { path: { id: "user_XXXXXX" } } }); * return user; * } * ``` */ company: typeof company; notifications: typeof notifications; lastActivity: typeof lastActivity; }; export declare const makeWebhookHandler: ({ signatureKey }?: { signatureKey?: string | undefined; }) => (req: Request, handlers: import("@whop-apps/typed-api/dist/webhooks/handlers").MethodHandlers) => Promise; export { and, authorizedUserOn, hasAccess, isAccessStringValid, isAuthenticated, makeAccessString, not, or, parseAccessString, } from "./access"; //# sourceMappingURL=index.d.ts.map