Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update client custom config code #732

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions framework/typescript/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ When your service is running in development mode `process.env.NODE_ENV=developme
## Code Example

```typescript
import { Client } from "@novu/framework";

const client = new Client({
secretKey: "my-secret-key",
strictAuthentication: false,
import { Client as NovuFrameworkClient } from "@novu/framework";
import { serve } from "@novu/framework/next";
import { passwordResetWorkflow } from "./workflows";

export const { GET, POST, OPTIONS } = serve({
client: new NovuFrameworkClient({
secretKey: process.env.NOVU_SECRET_KEY || "ACTUAL_NOVU_SECRET_KEY_VALUE",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as follows so as not to prompt users to hardcode secrets in their code.

Suggested change
secretKey: process.env.NOVU_SECRET_KEY || "ACTUAL_NOVU_SECRET_KEY_VALUE",
secretKey: process.env.NOVU_SECRET_KEY,

strictAuthentication: false,
}),
workflows: [
/* all workflows */
passwordResetWorkflow
],
});
```