export interface FronteggConstants { baseUrl: string; clientId: string; applicationId?: string | null; bundleId?: string | null; /** * iOS only: the `useAssetLinks` key from `Frontegg.plist`, when present * (companion to frontegg-ios-swift#293 — the wrapper forwards the plist as-is, * so the key reaches the native SDK once it supports it). `null`/`undefined` * when the key is not set or on Android. */ useAssetLinks?: boolean | null; /** Android only: `FRONTEGG_USE_ASSETS_LINKS` from the host app's BuildConfig. */ useAssetsLinks?: boolean; /** Android only: `FRONTEGG_USE_CHROME_CUSTOM_TABS` from the host app's BuildConfig. */ useChromeCustomTabs?: boolean; } export declare function getConstants(): FronteggConstants; /** * Stable, cross-platform rejection codes for `login()` (issue #110). * * - `user_cancelled` — the user dismissed/cancelled the login flow. * - `oauth_failed` — the OAuth/hosted-login exchange failed (bad code exchange, * invalid OAuth state, failed authentication, etc.). * - `network` — a network-level failure was detected by the native SDK. * - `unknown` — anything the wrapper cannot classify; inspect `nativeCode`. * * Mapping is conservative: only failures the native layer can positively * identify get a specific code, everything else is `unknown` with the raw * platform details preserved on `nativeCode` / `nativeMessage`. */ export type FronteggLoginErrorCode = 'user_cancelled' | 'oauth_failed' | 'network' | 'unknown'; /** The error `login()` rejects with (issue #110). */ export interface FronteggLoginError extends Error { code: FronteggLoginErrorCode; message: string; /** Convenience flag, equivalent to `code === 'user_cancelled'`. */ userCancelled: boolean; /** * Raw platform error code, preserved for debugging/telemetry: * iOS — `FronteggError` failure reason (e.g. `"operationCanceled"`, * `"couldNotExchangeToken"`); Android — the SDK exception class name * (e.g. `"CanceledByUserException"`). */ nativeCode?: string; /** Raw platform error message. */ nativeMessage?: string; } /** * Normalizes a native `login()` rejection into a `FronteggLoginError`. * The native bridges already reject with the stable codes above; this keeps * the shape guaranteed even for older native layers or unexpected errors. * Exported for testing. */ export declare function normalizeLoginError(e: unknown): FronteggLoginError; /** * Opens the Frontegg login flow. Resolves when login completes successfully; * rejects with a {@link FronteggLoginError} when it fails or is cancelled. */ export declare function login(loginHint?: string): Promise; export declare function logout(): Promise; export declare function switchTenant(tenantId: string): Promise; export declare function refreshToken(): Promise; /** * Starts a direct login action (e.g. a specific social provider) in the embedded login flow. * * Note on `ephemeralSession` / `additionalQueryParams`: these are currently honored on **iOS * only**. On Android the underlying native SDK's `directLoginAction` does not yet accept them, * so they are ignored there (tracked upstream in `frontegg-android-kotlin`). `ephemeralSession` * is inherently iOS-specific (it maps to the ASWebAuthenticationSession browser session). */ export declare function directLoginAction(type: string, data: string, ephemeralSession?: boolean, additionalQueryParams?: Record): Promise; export declare function loginWithPasskeys(): Promise; export declare function requestAuthorize(refreshToken: string, deviceTokenCookie?: string): Promise; /** Max age in seconds for step-up validity (same semantics as native SDK). */ export declare function isSteppedUp(maxAge?: number): Promise; /** Starts step-up authentication (MFA / re-auth). Max age in seconds. */ export declare function stepUp(maxAge?: number): Promise; export declare function registerPasskeys(): Promise; export declare function openAdminPortal(): Promise; export interface Entitlement { /** Whether the user is entitled to the requested feature/permission. */ isEntitled: boolean; /** * Optional reason when `isEntitled` is false — e.g. `"NOT_AUTHENTICATED"`, * `"ENTITLEMENTS_NOT_LOADED"`, `"MISSING_FEATURE"`, `"MISSING_PERMISSION"`. */ justification?: string | null; } /** * Loads the current user's entitlements into the SDK cache. Call this after * authentication (and again with `forceRefresh` to refetch) before reading * feature/permission entitlements. Resolves to `true` when entitlements loaded. */ export declare function loadEntitlements(forceRefresh?: boolean): Promise; /** Returns the on-device entitlement for a feature-flag key. */ export declare function getFeatureEntitlement(key: string): Promise; /** Returns the on-device entitlement for a permission key. */ export declare function getPermissionEntitlement(key: string): Promise; export declare function listener(callback: (res: any) => any): import("react-native").EmitterSubscription; //# sourceMappingURL=FronteggNative.d.ts.map