Skip to content

Commit

Permalink
Fix keys
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbleasel committed Jan 12, 2025
1 parent 641f3a4 commit beef5ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/notifications/components/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { KnockFeedProvider, KnockProvider } from '@knocklabs/react';
import type { ReactNode } from 'react';
import { keys } from '../keys';

const knockApiKey = keys().KNOCK_API_KEY;
const knockFeedChannelId = keys().KNOCK_FEED_CHANNEL_ID;
const knockApiKey = keys().NEXT_PUBLIC_KNOCK_API_KEY;
const knockFeedChannelId = keys().NEXT_PUBLIC_KNOCK_FEED_CHANNEL_ID;

type NotificationsProviderProps = {
children: ReactNode;
Expand Down
11 changes: 7 additions & 4 deletions packages/notifications/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import { z } from 'zod';
export const keys = () =>
createEnv({
server: {
KNOCK_API_KEY: z.string().min(1).optional(),
KNOCK_FEED_CHANNEL_ID: z.string().min(1).optional(),
KNOCK_SECRET_API_KEY: z.string().min(1).optional(),
},
client: {
NEXT_PUBLIC_KNOCK_API_KEY: z.string().min(1).optional(),
NEXT_PUBLIC_KNOCK_FEED_CHANNEL_ID: z.string().min(1).optional(),
},
runtimeEnv: {
KNOCK_API_KEY: process.env.KNOCK_API_KEY,
KNOCK_FEED_CHANNEL_ID: process.env.KNOCK_FEED_CHANNEL_ID,
NEXT_PUBLIC_KNOCK_API_KEY: process.env.NEXT_PUBLIC_KNOCK_API_KEY,
NEXT_PUBLIC_KNOCK_FEED_CHANNEL_ID:
process.env.NEXT_PUBLIC_KNOCK_FEED_CHANNEL_ID,
KNOCK_SECRET_API_KEY: process.env.KNOCK_SECRET_API_KEY,
},
});

0 comments on commit beef5ef

Please sign in to comment.