#CORS problem with backend http url

1 messages · Page 1 of 1 (latest)

zenith scaffold
#

How can avoid cors problem with http backend url?

static crownBOT
#

Hi @zenith scaffold, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question.

#

Answer

To avoid CORS problems with an HTTP backend URL when working with Novu, it's important to understand that Novu's APIs are designed for use on the server side. If you are trying to use the API directly from the browser, you will encounter CORS errors. You should make API calls from your server side or leverage Novu's client-side libraries to fetch in-app notifications, which are designed to handle such scenarios appropriately (1) .

For server-side interactions, setting up your environment correctly and ensuring that your server-side code handles requests to Novu's API without exposing them directly to the client-side is crucial. This involves sending requests to Novu from your server, where CORS policies do not apply, instead of making these requests directly from the browser.

If your setup requires direct interactions from the client side, you're recommended to use Novu's client-side libraries that are specifically designed for such purposes. These libraries include components and utilities for embedding a fully functional notification center into your application without running into CORS issues (2) .

For detailed instructions on configuring your server-side environment and using Novu's client-side libraries, please refer to the official Novu documentation provided in the footnotes.

static crownBOT
tepid warren
#

Please create one post for one issue 🙏🏻

zenith scaffold
#

sorry