@scalemule/nextjs 0.0.30 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -294,6 +294,8 @@ interface UsePushNotificationsOptions {
294
294
  serviceWorkerUrl?: string;
295
295
  /** Push proxy URL (default: '/api/push') */
296
296
  pushProxyUrl?: string;
297
+ /** Where the user subscribed (e.g., 'landing_prompt', 'post_signup', 'settings') */
298
+ registrationSource?: string;
297
299
  /** Called when a push notification is received while app is in foreground */
298
300
  onNotification?: (data: unknown) => void;
299
301
  }
package/dist/index.d.ts CHANGED
@@ -294,6 +294,8 @@ interface UsePushNotificationsOptions {
294
294
  serviceWorkerUrl?: string;
295
295
  /** Push proxy URL (default: '/api/push') */
296
296
  pushProxyUrl?: string;
297
+ /** Where the user subscribed (e.g., 'landing_prompt', 'post_signup', 'settings') */
298
+ registrationSource?: string;
297
299
  /** Called when a push notification is received while app is in foreground */
298
300
  onNotification?: (data: unknown) => void;
299
301
  }
package/dist/index.js CHANGED
@@ -3060,7 +3060,7 @@ function getCsrfToken() {
3060
3060
  return match ? decodeURIComponent(match[1]) : "";
3061
3061
  }
3062
3062
  function usePushNotifications(options = {}) {
3063
- const { serviceWorkerUrl = "/sw.js", pushProxyUrl = "/api/push", onNotification } = options;
3063
+ const { serviceWorkerUrl = "/sw.js", pushProxyUrl = "/api/push", registrationSource, onNotification } = options;
3064
3064
  const { user } = useScaleMule();
3065
3065
  const [isSupported, setIsSupported] = react.useState(false);
3066
3066
  const [permission, setPermission] = react.useState("unsupported");
@@ -3127,7 +3127,7 @@ function usePushNotifications(options = {}) {
3127
3127
  const manager = react.useMemo(() => {
3128
3128
  if (typeof window === "undefined") return null;
3129
3129
  try {
3130
- return new sdk.WebPushManager({ fetcher, serviceWorkerUrl });
3130
+ return new sdk.WebPushManager({ fetcher, serviceWorkerUrl, registrationSource });
3131
3131
  } catch {
3132
3132
  return null;
3133
3133
  }
package/dist/index.mjs CHANGED
@@ -3058,7 +3058,7 @@ function getCsrfToken() {
3058
3058
  return match ? decodeURIComponent(match[1]) : "";
3059
3059
  }
3060
3060
  function usePushNotifications(options = {}) {
3061
- const { serviceWorkerUrl = "/sw.js", pushProxyUrl = "/api/push", onNotification } = options;
3061
+ const { serviceWorkerUrl = "/sw.js", pushProxyUrl = "/api/push", registrationSource, onNotification } = options;
3062
3062
  const { user } = useScaleMule();
3063
3063
  const [isSupported, setIsSupported] = useState(false);
3064
3064
  const [permission, setPermission] = useState("unsupported");
@@ -3125,7 +3125,7 @@ function usePushNotifications(options = {}) {
3125
3125
  const manager = useMemo(() => {
3126
3126
  if (typeof window === "undefined") return null;
3127
3127
  try {
3128
- return new WebPushManager({ fetcher, serviceWorkerUrl });
3128
+ return new WebPushManager({ fetcher, serviceWorkerUrl, registrationSource });
3129
3129
  } catch {
3130
3130
  return null;
3131
3131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -52,7 +52,7 @@
52
52
  "clean": "rm -rf dist"
53
53
  },
54
54
  "dependencies": {
55
- "@scalemule/sdk": ">=0.0.23"
55
+ "@scalemule/sdk": "^0.0.26"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "next": ">=14.0.0",