UNPKG

@anam-ai/js-sdk

Version:

Client side JavaScript SDK for Anam AI

25 lines 1.12 kB
import AnamClient from './AnamClient'; /** * Create a new Anam client. * @param sessionToken - A session token can be obtained from the Anam API. * @param personaConfig - The persona configuration to use. * @param options - Additional options. * @returns A new Anam client instance. */ const createClient = (sessionToken, personaConfig, options) => { return new AnamClient(sessionToken, personaConfig, options); }; /** * Create a new Anam client with an API key instead of a session token. * This method is unsafe for production environments because it requires exposing your API key to the client side. * Only use this method for local testing. * @param apiKey - Your Anam API key. * @param personaConfig - The persona configuration to use. * @param options - Additional options. * @returns A new Anam client instance. */ const unsafe_createClientWithApiKey = (apiKey, personaConfig, options) => { return new AnamClient(undefined, personaConfig, Object.assign(Object.assign({}, options), { apiKey })); }; export { createClient, unsafe_createClientWithApiKey }; //# sourceMappingURL=index.js.map