-
-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05e0449
commit fb1e6d9
Showing
7 changed files
with
239 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Knock } from '@knocklabs/node'; | ||
|
||
const knockApiKey = process.env.KNOCK_API_KEY; | ||
|
||
if (!knockApiKey) { | ||
throw new Error('KNOCK_API_KEY is not set'); | ||
} | ||
|
||
export const knock = new Knock(knockApiKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { KnockFeedProvider, KnockProvider } from '@knocklabs/react'; | ||
import type { ReactNode } from 'react'; | ||
|
||
const knockApiKey = process.env.KNOCK_API_KEY; | ||
const knockFeedChannelId = process.env.KNOCK_FEED_CHANNEL_ID; | ||
|
||
if (!knockApiKey) { | ||
throw new Error('KNOCK_API_KEY is not set'); | ||
} | ||
|
||
if (!knockFeedChannelId) { | ||
throw new Error('KNOCK_FEED_CHANNEL_ID is not set'); | ||
} | ||
|
||
export const NotificationsProvider = ({ | ||
children, | ||
userId, | ||
}: { children: ReactNode; userId: string }) => ( | ||
<KnockProvider apiKey={knockApiKey} userId={userId}> | ||
<KnockFeedProvider feedId={knockFeedChannelId}> | ||
{children} | ||
</KnockFeedProvider> | ||
</KnockProvider> | ||
); |
Oops, something went wrong.