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

@@ -71,6 +71,7 @@ export function OpenPanelComponent({
<>
<Script src={cdnUrl ?? CDN_URL} async defer />
<Script
strategy="beforeInteractive"
dangerouslySetInnerHTML={{
__html: `window.op = window.op || function(...args) {(window.op.q = window.op.q || []).push(args)};
${methods

View File

@@ -1,6 +1,6 @@
{
"name": "@openpanel/nextjs",
"version": "1.0.7-local",
"version": "1.0.8-local",
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",

View File

@@ -1,6 +1,7 @@
import { defineConfig } from 'tsup';
export default defineConfig({
format: ['cjs', 'esm'],
entry: ['index.tsx', 'server.ts'],
external: ['react', 'next'],
dts: true,