Skip to content

v0

Add multi-channel notifications to your v0 app using Sendivent's API.

Overview

v0 by Vercel generates Next.js apps from prompts. This guide shows how to add notification support — email, SMS, Slack, push, and more — to apps built with v0.

Prerequisites

  1. A Sendivent account with an API key
  2. At least one event configured in your Sendivent dashboard
  3. A v0 project

Integration Steps

1. Prompt v0

Paste this prompt into v0's chat:

Add Sendivent notification support. Create a Next.js API route at
/api/notify that sends notifications via the Sendivent API.

API details:
- Endpoint: POST https://api.sendivent.com/v1/send/{event}
- Auth: Authorization: Bearer SENDIVENT_API_KEY (read from process.env)
- Request body: { "to": "user@example.com", "payload": { ...dynamic data } }
- Response: { "id": "notification-uuid", "event": "welcome", "status": "accepted" }

The API route should:
1. Read SENDIVENT_API_KEY from process.env
2. Accept event name, recipient, and payload in the request body
3. POST to the Sendivent API with Bearer token auth
4. Return the response

To send to a specific channel, use: POST /v1/send/{event}/{channel}
Supported channels: email, sms, slack, push, telegram, whatsapp, discord

2. Configure environment

Add your API key to your Vercel project (or .env.local for local development):

SENDIVENT_API_KEY=live_your_api_key

3. Test the integration

Trigger a notification flow in your app and check the Activity tab in your Sendivent dashboard.

Using Templates

Pass dynamic data via the payload field. Templates are managed in the Sendivent dashboard:

Update the API route to send a payment alert:

Event name: payment.failed
Recipient: the customer's email
Payload: { "amount": invoice.amount, "currency": "EUR", "retryUrl": retryLink }

Troubleshooting

Notifications not sending

  • Verify SENDIVENT_API_KEY is set in Vercel environment variables
  • Check the event exists in your Sendivent dashboard

401 Unauthorized

  • Confirm the API key is correct
  • Check key prefix matches API URL (test_*api-sandbox.sendivent.com, live_*api.sendivent.com)

Next Steps

Released under the MIT License.