@fullstory/server-api-client
Version:
The official FullStory server API client SDK for NodeJS.
23 lines • 860 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = exports.FullStoryImpl = void 0;
const invalidArgument_1 = require("./errors/invalidArgument");
const events_1 = require("./events");
const users_1 = require("./users");
class FullStoryImpl {
constructor(opts) {
this.opts = opts;
this.users = new users_1.UsersImpl(opts);
this.events = new events_1.EventsImpl(opts);
}
}
exports.FullStoryImpl = FullStoryImpl;
function init(opts) {
if (!opts.apiKey) {
throw new invalidArgument_1.FSInvalidArgumentError('The apiKey is required in opts.');
}
const apiKey = opts.apiKey.indexOf(' ') < 0 ? `Basic ${opts.apiKey}` : opts.apiKey;
return new FullStoryImpl(Object.assign(Object.assign({}, opts), { apiKey }));
}
exports.init = init;
//# sourceMappingURL=fullstory.js.map