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;

View File

@@ -4,7 +4,7 @@
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",
"build-for-openpanel": "pnpm build && cp dist/cdn.global.js ../../apps/public/public/op.js && cp dist/cdn.global.js ../../apps/test/public/op.js",
"build-for-openpanel": "pnpm build && cp dist/cdn.global.js ../../../apps/public/public/op.js && cp dist/cdn.global.js ../../../apps/test/public/op.js",
"lint": "eslint .",
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
"typecheck": "tsc --noEmit"