fine tuning sdks

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-12 13:41:04 +01:00
parent af4d775ee7
commit fe9e37a116
5 changed files with 6 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ export interface DecrementProfilePayload {
}
export interface OpenpanelSdkOptions {
url: string;
url?: string;
clientId: string;
clientSecret?: string;
verbose?: boolean;
@@ -136,7 +136,7 @@ export class OpenpanelSdk<
constructor(options: Options) {
this.options = options;
this.api = createApi(options.url);
this.api = createApi(options.url ?? 'https://api.openpanel.dev');
this.api.headers['openpanel-client-id'] = options.clientId;
if (this.options.clientSecret) {
this.api.headers['openpanel-client-secret'] = this.options.clientSecret;