MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / constructor

Method constructor

packages/sdks/sdk/src/index.ts:64–83  ·  view source on GitHub ↗
(options: OpenPanelOptions)

Source from the content-addressed store, hash-verified

62 queue: TrackHandlerPayload[] = [];
63
64 constructor(options: OpenPanelOptions) {
65 this.options = options;
66
67 const defaultHeaders: Record<string, string> = {
68 'openpanel-client-id': options.clientId,
69 };
70
71 if (options.clientSecret) {
72 defaultHeaders['openpanel-client-secret'] = options.clientSecret;
73 }
74
75 defaultHeaders['openpanel-sdk-name'] = options.sdk || 'node';
76 defaultHeaders['openpanel-sdk-version'] =
77 options.sdkVersion || process.env.SDK_VERSION!;
78
79 this.api = new Api({
80 baseUrl: options.apiUrl || 'https://api.openpanel.dev',
81 defaultHeaders,
82 });
83 }
84
85 // placeholder for future use
86 init() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected