fine tuning sdks
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user