@anam-ai/js-sdk
Version:
Client side JavaScript SDK for Anam AI
32 lines • 1.5 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.unsafe_createClientWithApiKey = exports.createClient = void 0;
const AnamClient_1 = __importDefault(require("./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_1.default(sessionToken, personaConfig, options);
};
exports.createClient = createClient;
/**
* 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_1.default(undefined, personaConfig, Object.assign(Object.assign({}, options), { apiKey }));
};
exports.unsafe_createClientWithApiKey = unsafe_createClientWithApiKey;
//# sourceMappingURL=index.js.map
;