Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix: add revenue to nextjs package and bump 1.0.18

Carl-Gerhard Lindesvärdf7055c0ebd99
diff --git a/packages/sdks/nextjs/index.tsx b/packages/sdks/nextjs/index.tsx
index fbe4b0283..123ac958c 100644
--- a/packages/sdks/nextjs/index.tsx
+++ b/packages/sdks/nextjs/index.tsx
@@ -121,6 +121,11 @@ export function useOpenPanel() {
decrement,
clear,
setGlobalProperties,
+ revenue,
+ flushRevenue,
+ clearRevenue,
+ pendingRevenue,
+ fetchDeviceId,
};
}
@@ -153,6 +158,22 @@ function decrement(payload: DecrementPayload) {
window.op('decrement', payload);
}
+function fetchDeviceId() {
+ return window.op.fetchDeviceId();
+}
+function clearRevenue() {
+ window.op.clearRevenue();
+}
+function pendingRevenue(amount: number, properties?: Record<string, unknown>) {
+ window.op.pendingRevenue(amount, properties);
+}
+function revenue(amount: number, properties?: Record<string, unknown>) {
+ return window.op.revenue(amount, properties);
+}
+function flushRevenue() {
+ return window.op.flushRevenue();
+}
+
function clear() {
window.op?.('clear');
}
diff --git a/packages/sdks/nextjs/package.json b/packages/sdks/nextjs/package.json
index 716478404..9bace3578 100644
--- a/packages/sdks/nextjs/package.json
+++ b/packages/sdks/nextjs/package.json
@@ -1,6 +1,6 @@
{
"name": "@openpanel/nextjs",
- "version": "1.0.17-local",
+ "version": "1.0.18-local",
"module": "index.ts",
"scripts": {
"build": "rm -rf dist && tsup",