@novu/nextjs 2.5.0
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/README.md +145 -0
- package/dist/client/index.d.mts +9 -0
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.js +62 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/index.mjs +62 -0
- package/dist/client/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +5 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/themes/index.d.mts +1 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +22 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/index.mjs +5 -0
- package/dist/themes/index.mjs.map +1 -0
- package/hooks/package.json +5 -0
- package/package.json +98 -0
- package/themes/package.json +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Novu's NextJS SDK for <Inbox />.
|
|
2
|
+
|
|
3
|
+
Novu provides the `@novu/nextjs` library that helps to add a fully functioning <Inbox /> to your web application in minutes.
|
|
4
|
+
See full documentation [here](https://docs.novu.co/inbox/react/get-started).
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
- Install `@novu/nextjs` npm package in your nextjs app
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @novu/nextjs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
- Add the below code in the app.tsx file
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import { Inbox } from '@novu/nextjs';
|
|
20
|
+
|
|
21
|
+
function Novu() {
|
|
22
|
+
return (
|
|
23
|
+
<Inbox
|
|
24
|
+
options={{
|
|
25
|
+
subscriberId: 'SUBSCRIBER_ID',
|
|
26
|
+
applicationIdentifier: 'APPLICATION_IDENTIFIER',
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Controlled Inbox
|
|
34
|
+
|
|
35
|
+
You can use the `open` prop to manage the Inbox popover open state.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
import { Inbox } from '@novu/nextjs';
|
|
39
|
+
|
|
40
|
+
function Novu() {
|
|
41
|
+
const [open, setOpen] = useState(false);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<Inbox
|
|
46
|
+
options={{
|
|
47
|
+
subscriberId: 'SUBSCRIBER_ID',
|
|
48
|
+
applicationIdentifier: 'APPLICATION_IDENTIFIER',
|
|
49
|
+
}}
|
|
50
|
+
open={isOpen}
|
|
51
|
+
/>
|
|
52
|
+
<button onClick={() => setOpen(true)}>Open Inbox</button>
|
|
53
|
+
<button onClick={() => setOpen(false)}>Close Inbox</button>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Localization
|
|
60
|
+
|
|
61
|
+
You can pass the `localization` prop to the Inbox component to change the language of the Inbox.
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
import { Inbox } from '@novu/nextjs';
|
|
65
|
+
|
|
66
|
+
function Novu() {
|
|
67
|
+
return (
|
|
68
|
+
<Inbox
|
|
69
|
+
options={{
|
|
70
|
+
subscriberId: 'SUBSCRIBER_ID',
|
|
71
|
+
applicationIdentifier: 'APPLICATION_IDENTIFIER',
|
|
72
|
+
}}
|
|
73
|
+
localization={{
|
|
74
|
+
'inbox.status.archived': 'Archived',
|
|
75
|
+
'inbox.status.unread': 'Unread',
|
|
76
|
+
'inbox.status.options.archived': 'Archived',
|
|
77
|
+
'inbox.status.options.unread': 'Unread',
|
|
78
|
+
'inbox.status.options.unreadRead': 'Unread/Read',
|
|
79
|
+
'inbox.status.unreadRead': 'Unread/Read',
|
|
80
|
+
'inbox.title': 'Inbox',
|
|
81
|
+
'notifications.emptyNotice': 'No notifications',
|
|
82
|
+
locale: 'en-US',
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## HMAC Encryption
|
|
90
|
+
|
|
91
|
+
When Novu's user adds the Inbox to their application they are required to pass a `subscriberId` which identifies the user's end-customer, and the application Identifier which is acted as a public key to communicate with the notification feed API.
|
|
92
|
+
|
|
93
|
+
A malicious actor can access the user feed by accessing the API and passing another `subscriberId` using the public application identifier.
|
|
94
|
+
|
|
95
|
+
HMAC encryption will make sure that a `subscriberId` is encrypted using the secret API key, and those will prevent malicious actors from impersonating users.
|
|
96
|
+
|
|
97
|
+
### Enabling HMAC Encryption
|
|
98
|
+
|
|
99
|
+
In order to enable Hash-Based Message Authentication Codes, you need to visit the admin panel In-App settings page and enable HMAC encryption for your environment.
|
|
100
|
+
|
|
101
|
+
<Frame caption="How to enable HMAC encryption for In-App Inbox">
|
|
102
|
+
<img src="/images/notification-center/client/react/get-started/hmac-encryption-enable.png" />
|
|
103
|
+
</Frame>
|
|
104
|
+
|
|
105
|
+
1. Next step would be to generate an HMAC encrypted subscriberId on your backend:
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
import { createHmac } from 'crypto';
|
|
109
|
+
|
|
110
|
+
const hmacHash = createHmac('sha256', process.env.NOVU_API_KEY).update(subscriberId).digest('hex');
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
2. Then pass the created HMAC to your client side application forward it to the component:
|
|
114
|
+
|
|
115
|
+
```jsx
|
|
116
|
+
<Inbox
|
|
117
|
+
subscriberId={'SUBSCRIBER_ID_PLAIN_VALUE'}
|
|
118
|
+
subscriberHash={'SUBSCRIBER_ID_HASH_VALUE'}
|
|
119
|
+
applicationIdentifier={'APPLICATION_IDENTIFIER'}
|
|
120
|
+
/>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
> Note: If HMAC encryption is active in In-App provider settings and `subscriberHash`
|
|
124
|
+
> along with `subscriberId` is not provided, then Inbox will not load
|
|
125
|
+
|
|
126
|
+
## Use your own backend and socket URL
|
|
127
|
+
|
|
128
|
+
By default, Novu's hosted services for API and socket are used. If you want, you can override them and configure your own.
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { Inbox } from '@novu/nextjs';
|
|
132
|
+
|
|
133
|
+
function Novu() {
|
|
134
|
+
return (
|
|
135
|
+
<Inbox
|
|
136
|
+
options={{
|
|
137
|
+
backendUrl: 'YOUR_BACKEND_URL',
|
|
138
|
+
socketUrl: 'YOUR_SOCKET_URL',
|
|
139
|
+
subscriberId: 'SUBSCRIBER_ID',
|
|
140
|
+
applicationIdentifier: 'APPLICATION_IDENTIFIER',
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InboxProps } from '@novu/react';
|
|
2
|
+
export { BaseProps, Bell, BellProps, BellRenderer, DefaultInboxProps, DefaultProps, InboxContent, InboxContentProps, InboxProps, Notification, NotificationProps, Notifications, NotificationsRenderer, Preferences, WithChildrenProps } from '@novu/react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export * from '@novu/react/hooks';
|
|
6
|
+
|
|
7
|
+
declare const Inbox: React.MemoExoticComponent<(props: InboxProps) => react_jsx_runtime.JSX.Element>;
|
|
8
|
+
|
|
9
|
+
export { Inbox };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InboxProps } from '@novu/react';
|
|
2
|
+
export { BaseProps, Bell, BellProps, BellRenderer, DefaultInboxProps, DefaultProps, InboxContent, InboxContentProps, InboxProps, Notification, NotificationProps, Notifications, NotificationsRenderer, Preferences, WithChildrenProps } from '@novu/react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
export * from '@novu/react/hooks';
|
|
6
|
+
|
|
7
|
+
declare const Inbox: React.MemoExoticComponent<(props: InboxProps) => react_jsx_runtime.JSX.Element>;
|
|
8
|
+
|
|
9
|
+
export { Inbox };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/index.ts
|
|
33
|
+
var src_exports = {};
|
|
34
|
+
__export(src_exports, {
|
|
35
|
+
Bell: () => import_react3.Bell,
|
|
36
|
+
Inbox: () => Inbox,
|
|
37
|
+
InboxContent: () => import_react3.InboxContent,
|
|
38
|
+
Notifications: () => import_react3.Notifications,
|
|
39
|
+
Preferences: () => import_react3.Preferences
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(src_exports);
|
|
42
|
+
|
|
43
|
+
// src/components/index.ts
|
|
44
|
+
var import_react3 = require("@novu/react");
|
|
45
|
+
|
|
46
|
+
// src/components/Inbox.tsx
|
|
47
|
+
var import_react = __toESM(require("react"));
|
|
48
|
+
var import_react2 = require("@novu/react");
|
|
49
|
+
var import_navigation = require("next/navigation");
|
|
50
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
+
var Inbox = import_react.default.memo((props) => {
|
|
52
|
+
const router = (0, import_navigation.useRouter)();
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Inbox, { routerPush: router.push, ...props });
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// src/hooks/index.ts
|
|
57
|
+
var hooks_exports = {};
|
|
58
|
+
__reExport(hooks_exports, require("@novu/react/hooks"));
|
|
59
|
+
|
|
60
|
+
// src/index.ts
|
|
61
|
+
__reExport(src_exports, hooks_exports, module.exports);
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/index.ts","../../src/components/Inbox.tsx","../../src/hooks/index.ts"],"sourcesContent":["'use client';\n\nexport * from './components';\nexport * from './hooks';\n","'use client';\n\nimport {\n BaseProps,\n Bell,\n BellProps,\n BellRenderer,\n DefaultInboxProps,\n DefaultProps,\n Inbox,\n InboxContent,\n InboxContentProps,\n InboxProps,\n Notification,\n NotificationProps,\n Notifications,\n NotificationsRenderer,\n Preferences,\n WithChildrenProps,\n} from '@novu/react';\n\nexport * from './Inbox';\n\nexport { Bell, InboxContent, Notifications, Preferences };\n\nexport type {\n BaseProps,\n BellProps,\n BellRenderer,\n DefaultInboxProps,\n DefaultProps,\n InboxContentProps,\n InboxProps,\n NotificationProps,\n NotificationsRenderer,\n WithChildrenProps,\n Notification,\n};\n","'use client';\n\nimport React from 'react';\nimport { InboxProps, Inbox as RInbox } from '@novu/react';\nimport { useRouter } from 'next/navigation';\n\nexport const Inbox = React.memo((props: InboxProps) => {\n const router = useRouter();\n\n return <RInbox routerPush={router.push} {...props} />;\n});\n","'use client';\n\nexport * from '@novu/react/hooks';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,IAAAA,gBAiBO;;;ACjBP,mBAAkB;AAClB,IAAAC,gBAA4C;AAC5C,wBAA0B;AAKjB;AAHF,IAAM,QAAQ,aAAAC,QAAM,KAAK,CAAC,UAAsB;AACrD,QAAM,aAAS,6BAAU;AAEzB,SAAO,4CAAC,cAAAC,OAAA,EAAO,YAAY,OAAO,MAAO,GAAG,OAAO;AACrD,CAAC;;;ACVD;AAEA,0BAAc;;;AHCd,wBAAc,eAHd;","names":["import_react","import_react","React","RInbox"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Bell: () => Bell,
|
|
24
|
+
Inbox: () => Inbox,
|
|
25
|
+
InboxContent: () => InboxContent,
|
|
26
|
+
Notifications: () => Notifications,
|
|
27
|
+
Preferences: () => Preferences
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// src/components/index.ts
|
|
31
|
+
import {
|
|
32
|
+
Bell,
|
|
33
|
+
InboxContent,
|
|
34
|
+
Notifications,
|
|
35
|
+
Preferences
|
|
36
|
+
} from "@novu/react";
|
|
37
|
+
|
|
38
|
+
// src/components/Inbox.tsx
|
|
39
|
+
import React from "react";
|
|
40
|
+
import { Inbox as RInbox } from "@novu/react";
|
|
41
|
+
import { useRouter } from "next/navigation";
|
|
42
|
+
import { jsx } from "react/jsx-runtime";
|
|
43
|
+
var Inbox = React.memo((props) => {
|
|
44
|
+
const router = useRouter();
|
|
45
|
+
return /* @__PURE__ */ jsx(RInbox, { routerPush: router.push, ...props });
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// src/hooks/index.ts
|
|
49
|
+
var hooks_exports = {};
|
|
50
|
+
__reExport(hooks_exports, hooks_star);
|
|
51
|
+
import * as hooks_star from "@novu/react/hooks";
|
|
52
|
+
|
|
53
|
+
// src/index.ts
|
|
54
|
+
__reExport(src_exports, hooks_exports);
|
|
55
|
+
export {
|
|
56
|
+
Bell,
|
|
57
|
+
Inbox,
|
|
58
|
+
InboxContent,
|
|
59
|
+
Notifications,
|
|
60
|
+
Preferences
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/components/index.ts","../../src/components/Inbox.tsx","../../src/hooks/index.ts"],"sourcesContent":["'use client';\n\nexport * from './components';\nexport * from './hooks';\n","'use client';\n\nimport {\n BaseProps,\n Bell,\n BellProps,\n BellRenderer,\n DefaultInboxProps,\n DefaultProps,\n Inbox,\n InboxContent,\n InboxContentProps,\n InboxProps,\n Notification,\n NotificationProps,\n Notifications,\n NotificationsRenderer,\n Preferences,\n WithChildrenProps,\n} from '@novu/react';\n\nexport * from './Inbox';\n\nexport { Bell, InboxContent, Notifications, Preferences };\n\nexport type {\n BaseProps,\n BellProps,\n BellRenderer,\n DefaultInboxProps,\n DefaultProps,\n InboxContentProps,\n InboxProps,\n NotificationProps,\n NotificationsRenderer,\n WithChildrenProps,\n Notification,\n};\n","'use client';\n\nimport React from 'react';\nimport { InboxProps, Inbox as RInbox } from '@novu/react';\nimport { useRouter } from 'next/navigation';\n\nexport const Inbox = React.memo((props: InboxProps) => {\n const router = useRouter();\n\n return <RInbox routerPush={router.push} {...props} />;\n});\n","'use client';\n\nexport * from '@novu/react/hooks';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA;AAAA,EAEE;AAAA,EAMA;AAAA,EAKA;AAAA,EAEA;AAAA,OAEK;;;ACjBP,OAAO,WAAW;AAClB,SAAqB,SAAS,cAAc;AAC5C,SAAS,iBAAiB;AAKjB;AAHF,IAAM,QAAQ,MAAM,KAAK,CAAC,UAAsB;AACrD,QAAM,SAAS,UAAU;AAEzB,SAAO,oBAAC,UAAO,YAAY,OAAO,MAAO,GAAG,OAAO;AACrD,CAAC;;;ACVD;AAEA;AAAA,4BAAc;;;AHCd,wBAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@novu/react/hooks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@novu/react/hooks';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
|
+
|
|
18
|
+
// src/hooks/index.ts
|
|
19
|
+
var hooks_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
21
|
+
__reExport(hooks_exports, require("@novu/react/hooks"), module.exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["'use client';\n\nexport * from '@novu/react/hooks';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,0BAAc,8BAFd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["'use client';\n\nexport * from '@novu/react/hooks';\n"],"mappings":";;;AAEA,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@novu/react/themes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@novu/react/themes';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
17
|
+
|
|
18
|
+
// src/themes/index.ts
|
|
19
|
+
var themes_exports = {};
|
|
20
|
+
module.exports = __toCommonJS(themes_exports);
|
|
21
|
+
__reExport(themes_exports, require("@novu/react/themes"), module.exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/themes/index.ts"],"sourcesContent":["'use client';\n\nexport * from '@novu/react/themes';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAEA,2BAAc,+BAFd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/themes/index.ts"],"sourcesContent":["'use client';\n\nexport * from '@novu/react/themes';\n"],"mappings":";;;AAEA,cAAc;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@novu/nextjs",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"repository": "https://github.com/novuhq/novu",
|
|
5
|
+
"description": "Novu's Next.js SDK for building custom inbox notification experiences",
|
|
6
|
+
"author": "",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/client/index.js",
|
|
9
|
+
"module": "dist/client/index.mjs",
|
|
10
|
+
"types": "dist/client/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/client/index.d.mts",
|
|
15
|
+
"default": "./dist/client/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/client/index.d.ts",
|
|
19
|
+
"default": "./dist/client/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"./hooks": {
|
|
23
|
+
"import": {
|
|
24
|
+
"types": "./dist/hooks/index.d.mts",
|
|
25
|
+
"default": "./dist/hooks/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"require": {
|
|
28
|
+
"types": "./dist/hooks/index.d.ts",
|
|
29
|
+
"default": "./dist/hooks/index.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"./themes": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/themes/index.d.mts",
|
|
35
|
+
"default": "./dist/themes/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/themes/index.d.ts",
|
|
39
|
+
"default": "./dist/themes/index.js"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"dist/client/**/*",
|
|
46
|
+
"dist/hooks/**/*",
|
|
47
|
+
"dist/themes/**/*",
|
|
48
|
+
"hooks/**/*",
|
|
49
|
+
"themes/**/*"
|
|
50
|
+
],
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"private": false,
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build:watch": "tsup --watch",
|
|
58
|
+
"build": "tsup && pnpm run check-exports",
|
|
59
|
+
"lint": "eslint src",
|
|
60
|
+
"check-exports": "attw --pack ."
|
|
61
|
+
},
|
|
62
|
+
"browserslist": {
|
|
63
|
+
"production": [
|
|
64
|
+
">0.2%",
|
|
65
|
+
"not dead",
|
|
66
|
+
"not op_mini all"
|
|
67
|
+
],
|
|
68
|
+
"development": [
|
|
69
|
+
"last 1 chrome version",
|
|
70
|
+
"last 1 firefox version",
|
|
71
|
+
"last 1 safari version"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
76
|
+
"@types/node": "^20.14.12",
|
|
77
|
+
"@types/react": "*",
|
|
78
|
+
"@types/react-dom": "*",
|
|
79
|
+
"tsup": "^8.2.1",
|
|
80
|
+
"typescript": "5.6.2"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"react": ">=17",
|
|
84
|
+
"react-dom": ">=17",
|
|
85
|
+
"next": ">=13"
|
|
86
|
+
},
|
|
87
|
+
"peerDependenciesMeta": {
|
|
88
|
+
"react-dom": {
|
|
89
|
+
"optional": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@novu/react": "^2.5.0"
|
|
94
|
+
},
|
|
95
|
+
"nx": {
|
|
96
|
+
"tags": ["package:public"]
|
|
97
|
+
}
|
|
98
|
+
}
|