/** * Server-side Turnkey client utilities */ import { Turnkey } from '@turnkey/sdk-server'; export interface TurnkeyClientConfig { /** Turnkey API base URL (default: https://api.turnkey.com) */ apiBaseUrl?: string; /** Turnkey API public key */ apiPublicKey: string; /** Turnkey API private key */ apiPrivateKey: string; /** Default organization ID */ organizationId: string; } /** * Create a Turnkey server client */ export declare function createTurnkeyClient(config?: Partial): Turnkey; /** * Normalize an email address for use as a stable identity key. * * Turnkey sub-org lookup filters on the exact email string, so * `Alice@x.com` and `alice@x.com` would otherwise resolve to different * sub-organizations and fork the user's identity. */ export declare function normalizeEmail(email: string): string; /** * Get or create a Turnkey sub-organization for a user. * * The sub-org ID is the user's **stable identity** (JWT `sub`, user-record * key, DID ownership), so this function must never mint a second sub-org for * an email that already has one: * - the email is normalized (trim + lowercase) before every Turnkey filter; * - a lookup failure only falls through to creation on a definitive * not-found — transient/API errors are rethrown; * - an existing sub-org that lacks a wallet gets a wallet created **in * place** rather than being replaced by a new sub-org; * - when multiple sub-orgs match the email (a pre-existing anomaly), the * selection is deterministic so every login resolves the same identity. */ export declare function getOrCreateTurnkeySubOrg(email: string, turnkeyClient: Turnkey): Promise; //# sourceMappingURL=turnkey-client.d.ts.map