sdk(astro,nextjs): add astro sdk and ensure window.op always first on nextjs

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-05-06 22:10:38 +02:00
parent 0189b922f2
commit 2d8f6f36f6
17 changed files with 2110 additions and 83 deletions

View File

@@ -0,0 +1,9 @@
---
import type { IdentifyPayload } from '@openpanel/web';
import { filterProps } from './asto-utils';
interface Props extends IdentifyPayload {}
const props = Astro.props as Props;
---
<script is:inline set:html={`window.op('identify', ${JSON.stringify(filterProps(props))});`} />