CORS problem with backend http url
How can avoid cors problem with http backend url?
5 Replies
Hi @_7eo., 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.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* API Overview
* Overview
* Others
* Run Novu in local machine
-----------------------------
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.
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
@_7eo. this also seems to be duplicate of
https://discord.com/channels/895029566685462578/1236136554565599272
Please create one post for one issue 🙏🏻
sorry
i will