import { CreateSessionTokenRequestBody, CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api'; export { CreateSessionTokenReturnType } from '@moonpay/platform-protocol/api'; import { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer'; export { CustomerExportIdentity } from '@moonpay/platform-protocol/api/customer'; import { CreateSessionError, RevokeSessionError, ExportCustomerError } from '@moonpay/platform-protocol/api/errors'; export { CreateSessionError, ExportCustomerError, RevokeSessionError } from '@moonpay/platform-protocol/api/errors'; import { Result, EmptyResult } from '@moonpay/platform-protocol/result'; export { EmptyResult, Result } from '@moonpay/platform-protocol/result'; /** Session creation input — aligned with `CreateSessionTokenRequestBody` from the Platform API. */ type CreateSessionParams = CreateSessionTokenRequestBody; interface ExportCustomerParams { /** * One-time consent token from the customer-export frame's `complete` * event (web/RN SDK). Valid for 5 minutes. */ consentToken: string; } interface RevokeSessionParams { /** The external customer identifier whose sessions should be revoked. */ externalCustomerId: string; } interface CreateServerClientOptions { /** Your MoonPay secret API key. Never expose this client-side. */ apiKey: string; /** Override the API base URL. Defaults to production. */ baseUrl?: string; } interface ServerClient { /** Create a session token for a customer. */ createSession(params: CreateSessionParams): Promise>; /** Revoke all sessions for a customer (by external customer ID). */ revokeSession(params: RevokeSessionParams): Promise>; /** * Exchange a one-time consent token (from the customer-export frame's * `complete` event, web/RN SDK) for the customer's verified MoonPay * identity. Call within the token's validity window. */ exportCustomer(params: ExportCustomerParams): Promise>; } /** * Creates a server-side MoonPay client for session management. * * This client uses your secret API key and must only be used in * server-side environments (Node.js, edge functions, etc.). */ declare function createServerClient(options: CreateServerClientOptions): ServerClient; export { type CreateServerClientOptions, type CreateSessionParams, type ExportCustomerParams, type RevokeSessionParams, type ServerClient, createServerClient };