# Notifications

### Web Push

Setting up web push requires FCM

Go to <https://console.firebase.google.com/u/0/project/\\[yourprojectid]/messaging/onboarding>

<figure><img src="/files/jqyjgrrON3xLxxdQUMfK" alt=""><figcaption></figcaption></figure>

### Web Push

You are required to set up the following environment variables

```
VAPID_FCM_KEY=***
VAPID_PUBLIC_KEY=***
VAPID_PRIVATE_KEY=***
```

You can use the novel cli to get these via

```
novel add vapid
```

and it will walk you through the steps to get these variables

You can then use the api from your controllers via

```
import * as push from 'novel/push';

await push.web({ to: ["account_ID"] } }, { body: "Your Message" });
```

### Mail

Similarly, you can use the same api to send an email notification

```
import * as push from 'novel/push';

await push.mail({ to: ["account_ID"] } }, { body: "Your Message" });
```

You can modify the mail template under `app/templates/mail/notification/message.tsx`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.novel.dev/novel-server/notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
