Files
stats/apps/start/src/utils/op.ts
Carl-Gerhard Lindesvärd 212254d31a feat: new importer (#214)
2025-11-05 09:49:36 +01:00

21 lines
430 B
TypeScript

import { OpenPanel } from '@openpanel/web';
const clientId = import.meta.env.VITE_OP_CLIENT_ID;
const createOpInstance = () => {
if (!clientId || clientId === 'undefined') {
return new Proxy({} as OpenPanel, {
get: () => () => {},
});
}
return new OpenPanel({
clientId,
trackScreenViews: true,
trackOutgoingLinks: true,
trackAttributes: true,
});
};
export const op = createOpInstance();