fix sdk version

This commit is contained in:
goenning 2023-09-01 15:24:42 +01:00
parent 47042f043b
commit ce24e8f4fb
12 changed files with 31 additions and 7 deletions

View file

@ -1 +1,3 @@
export * from '@aptabase/react';
globalThis.__APTABASE_SDK_VERSION__ = `aptabase-nextjs@${process.env.PKG_VERSION}`;

1
packages/nextjs/src/global.d.ts vendored Normal file
View file

@ -0,0 +1 @@
declare var __APTABASE_SDK_VERSION__: string;

View file

@ -3,6 +3,8 @@ import { type AptabaseOptions } from '@aptabase/node';
import { type NextIncomingMessage } from 'next/dist/server/request-meta';
import { headers } from 'next/headers';
globalThis.__APTABASE_SDK_VERSION__ = `aptabase-nextjs@${process.env.PKG_VERSION}`;
export function init(appKey: string, options?: AptabaseOptions): void {
node.init(appKey, options);
}

View file

@ -1,4 +1,5 @@
import { defineConfig } from 'tsup';
const { version } = require('./package.json');
export default defineConfig({
entry: ['src/index.ts', 'src/server.ts', 'src/client.tsx'],
@ -8,4 +9,7 @@ export default defineConfig({
minify: true,
sourcemap: true,
clean: true,
env: {
PKG_VERSION: version,
},
});