fix: add revenue to nextjs package and bump 1.0.18

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-25 09:23:11 +01:00
parent c9cf0274af
commit f7055c0ebd
2 changed files with 22 additions and 1 deletions

View File

@@ -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');
}

View File

@@ -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",