Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(apikey: string, options?: ClientOptions) {
super();
/* istanbul ignore next */
Sentry.configureScope(scope => {
scope.setTag('apikey', apikey);
scope.setTag('sdk-version', getVersion());
scope.setExtra('clientOptions', options);
});
if (!apikey || typeof apikey !== 'string' || apikey.length === 0) {
throw new Error('An apikey is required to initialize the Filestack client');
}
const { urls } = config;
this.session = { apikey, urls };
if (options) {
const { cname, security } = options;
this.setSecurity(security);
this.setCname(cname);