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

Add dynamic backendUrl in @novu/node #535

Merged

Conversation

djabarovgeorge
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented May 4, 2022

NV-379 Add backendUrl optional configuration to @novu/node

Why?

To allow our novu/node users to specify their own custom implementation of backend API instead of automatically using our cloud API.

How?

const novu = new Novu(API_KEY, { backendUrl: '' });

the second object is optional.

@vercel
Copy link

vercel bot commented May 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
docs ⬜️ Ignored (Inspect) May 8, 2022 at 8:20AM (UTC)

@gitpod-io
Copy link

gitpod-io bot commented May 4, 2022

@djabarovgeorge djabarovgeorge requested a review from scopsy May 4, 2022 15:37
super();

const backendUrl = config?.backendUrl
? config?.backendUrl
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think, should we append the v1 at the end of the URL?

Suggested change
? config?.backendUrl
? config?.backendUrl + '/v1'

This way the SDK can manage different versions for himself.

Copy link
Contributor

@scopsy scopsy left a comment

Choose a reason for hiding this comment

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

Looks Great, the only thing I would think is to add the v1 inside the node package.

@scopsy scopsy merged commit 8a72e9d into main May 8, 2022
@scopsy scopsy deleted the NV-379-Add-backendUrl-optional-configuration-to-@novu/node branch May 8, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants