Skip to content

Lovable

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

Overview

Lovable builds full-stack web apps from natural language prompts. This guide shows how to add notification support — email, SMS, Slack, push, and more — to apps built with Lovable.

Prerequisites

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

Integration Steps

1. Add your API key to Supabase

In your Supabase dashboard, add SENDIVENT_API_KEY as a secret:

  1. Go to Project SettingsEdge FunctionsSecrets
  2. Add a new secret: SENDIVENT_API_KEY = your live_* or test_* key

2. Prompt Lovable

Paste this prompt into Lovable's chat:

Add Sendivent notification support to this app. Create a Supabase Edge
Function 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 environment)
- Request body: { "to": "user@example.com", "payload": { ...dynamic data } }
- Response: { "id": "notification-uuid", "event": "welcome", "status": "accepted" }

The Edge Function should:
1. Read SENDIVENT_API_KEY from Deno.env
2. Accept event name, recipient, and payload as parameters
3. POST to the Sendivent API with Bearer token auth
4. Return the response to the client

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

3. Test the integration

  1. Trigger a notification flow in your app
  2. Check the Activity tab in your Sendivent dashboard to verify delivery

Using Templates

Your Sendivent events use Handlebars templates configured in the dashboard. Pass dynamic data via the payload field:

Update the Edge Function to send an order confirmation:

Event name: order.confirmed
Recipient: the user's email
Payload: { "orderNumber": order.id, "total": order.total, "items": order.items }

The template is managed in the Sendivent dashboard — no HTML in your code.

Use Cases

  • Contact forms — Send form submissions via email
  • Signup flows — Welcome notifications on registration
  • Order confirmations — Multi-channel order updates (email + SMS)
  • Password resets — Secure reset links via email
  • Team alerts — Slack notifications for admin events

Troubleshooting

Notifications not sending

  • Verify SENDIVENT_API_KEY is set in Supabase Edge Function secrets
  • Check the event exists in your Sendivent dashboard
  • Use a test_* key with api-sandbox.sendivent.com for development

401 Unauthorized

  • Confirm the API key is correct and not expired
  • Check the key prefix matches the API URL (test_* → sandbox, live_* → production)

Next Steps

Released under the MIT License.