#Vue Notification Center Error with Status Code 400

1 messages · Page 1 of 1 (latest)

short wagonBOT
#

Hi @novel lake, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @short wagon with any follow-up questions.

#

Answer

When you encounter a 400 (Bad Request) error during the session initialization with the Novu notification center component in your Vue project, it often points to an issue with the provided identifiers, such as the subscriber ID or the application identifier. Here are some steps to check and ensure everything is configured correctly:

  1. Verify the Application Identifier and Subscriber ID: Ensure that the applicationIdentifier and subscriberId are correctly set in your Vue component. The applicationIdentifier should match the public key available in your Novu dashboard settings, and the subscriberId should ideally be the ID of the logged-in user to see their notifications in the notification center (1) .

  2. Ensure Environment Variables Are Correctly Set: If you are using environment variables (e.g., import.meta.env.NOVU_APP_IDENTIFIER) to store these identifiers, make sure they are correctly set in your .env file and accessible in your Vue application. You might need to restart your development server for changes to take effect.

  3. API Key: The API key should not be placed directly in your Vue code for security reasons. The API key is used on the server-side to create subscribers or trigger notifications through Novu's backend SDKs. You do not need to include the API key in your Vue application to use the notification center component (2) .

  4. Debugging Initialization: If the notification center still fails to load, double-check the initialization code in your Vue component against the documentation examples to ensure there's no deviation. The documentation provides clear examples of how to set up the notification center component in Vue [(1)](https://docs.novu.co/quickstar

Novu

Novu is an open-source notification infrastructure, built for engineering teams to help them build rich product notification experiences.

#

ts/vue#register-the-notification-center-plugin) .

If you've checked these steps and the issue persists, it's possible that there's a specific configuration or compatibility issue with your project setup. Since the error you're encountering is related to the session initialization request to the Novu API, verifying the identifiers and their correct usage in your Vue component is crucial. If the problem doesn't resolve, consider reaching out on the Novu GitHub issues or the community forum for more specific support, as they might need more details about your project setup to diagnose the issue accurately.