UNPKG

magically-sdk

Version:

Official SDK for Magically - Build mobile apps with AI

15 lines (14 loc) 697 B
import { APIClient } from './APIClient'; import { MagicallyAuth } from './MagicallyAuth'; /** * Get the appropriate authentication token based on the environment * * In edge environments (Cloudflare Workers), the API key is used automatically * and no token needs to be passed. In browser/Node environments, we need to * get the JWT token from the auth system. * * @param apiClient - The APIClient instance to check for edge environment * @param auth - The MagicallyAuth instance to get JWT token from * @returns The token to use (null in edge environment, JWT string otherwise) */ export declare function getAuthToken(apiClient: APIClient, auth: MagicallyAuth): Promise<string | null>;