prepare sdk packages

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-11 19:52:14 +01:00
parent e6c0bc2ec8
commit f9e5feb688
16 changed files with 68 additions and 64 deletions

View File

@@ -2,12 +2,21 @@ import Script from 'next/script';
import type {
OpenpanelEventOptions,
OpenpanelWebOptions,
OpenpanelOptions,
PostEventPayload,
UpdateProfilePayload,
} from '@openpanel/web';
const CDN_URL = 'http://localhost:3002/op.js';
const CDN_URL = 'https://openpanel.dev/op.js';
declare global {
interface Window {
op: {
q?: [string, ...any[]];
(method: OpenpanelMethods, ...args: any[]): void;
};
}
}
type OpenpanelMethods =
| 'ctor'
@@ -19,7 +28,7 @@ type OpenpanelMethods =
| 'clear';
declare global {
interface Window {
interface window {
op: {
q?: [string, ...any[]];
(method: OpenpanelMethods, ...args: any[]): void;
@@ -27,7 +36,7 @@ declare global {
}
}
type OpenpanelProviderProps = OpenpanelWebOptions & {
type OpenpanelProviderProps = OpenpanelOptions & {
profileId?: string;
cdnUrl?: string;
};