Skip to content

Lovable

Entrig connects to your Supabase database and sends notifications when rows are inserted, updated, or deleted. You describe the notification in Lovable’s chat and Entrig installs the trigger automatically.

Two channels are supported:

  • Email - no SDK required. Works with any Lovable web app out of the box.
  • Push - requires the Capacitor SDK. Use this when your Lovable app is exported as a native iOS or Android app.

One-time setup

These steps apply to both channels.

  1. Connect your Supabase project to Entrig

    Go to entrig.com and sign in. On the onboarding screen, click Connect Supabase and authorize via OAuth. Entrig installs a lightweight schema in your database (pg_net, a vault secret, and an event handler). This is a one-time step and Entrig never writes to your own tables.

  2. Copy your Entrig API key

    In the Entrig dashboard, open Settings -> API Keys and copy your project API key.

  3. Add Entrig to Lovable

    In your Lovable project, open Connectors -> Chat connectors -> New MCP server:

    FieldValue
    Server nameEntrig
    Server URLhttps://mcp.entrig.com
    AuthenticationBearer token - paste your Entrig API key

    Click Add server.


Email notifications

No SDK or code changes needed.

  1. Add an email provider

    In the Entrig dashboard, go to Settings -> Channels -> Email. Click Configure under your chosen provider. Resend is the fastest option: paste your API key, pick a verified domain, and set a From address. Full instructions: Resend, Mailgun, Amazon SES.

  2. Create a notification from Lovable’s chat

    Describe what you want and Entrig sets it up:

    Email the user when their order status changes to "shipped".
    Use their email column on the users table.
    Subject: "Your order has shipped"
    Body: "Hi {{users.name}}, your order is on its way."
    Send a welcome email to every new user when they sign up.
    From the users table, on INSERT.
    Email the workspace owner when someone joins their team.
    The members table has a workspace_id that links to workspaces,
    which has an owner_email column.

    Entrig reads your database schema, resolves the recipient and placeholders, and installs the trigger. It fires on the next matching database event - no deploy needed.


Push notifications

Push requires the @entrig/capacitor SDK. Your Lovable project must be set up as a Capacitor app targeting iOS or Android.

Configure FCM or APNs

In the Entrig dashboard, go to Settings -> Channels -> Push and configure your platform credentials. Full instructions: FCM (Android), APNs (iOS).

Set up the Capacitor SDK

The SDK setup involves native iOS and Android file changes. The fastest way is to use the entrig-capacitor agent skill in your code editor (Claude Code, Cursor, Windsurf). It handles the install, iOS native config, and code wiring automatically:

Terminal window
npx skills add entrig/entrig-skills

Then ask your agent: “Set up the Entrig Capacitor SDK in this project.” See Agent Skills for details.

To set up manually:

In your project terminal:

Terminal window
npm install @entrig/capacitor
npx cap sync

For iOS, run the setup command once from your project root:

Terminal window
npx @entrig/capacitor setup ios

This configures AppDelegate.swift, App.entitlements, and Info.plist automatically.

Initialize and register

Call init when the app starts, register when the user signs in, and unregister when they sign out:

import { Entrig } from '@entrig/capacitor';
// On app start
await Entrig.init({ apiKey: 'YOUR_ENTRIG_API_KEY' });
// On sign in
await Entrig.register({ userId: session.user.id });
// On sign out
await Entrig.unregister();

Use the Supabase Auth user ID as userId. It must match the user identifier field configured in your notification.

Handle notification taps

Entrig.addListener('onNotificationOpened', (event) => {
// navigate based on event.data
});

If the app was terminated when tapped, check on startup:

const notification = await Entrig.getInitialNotification();
if (notification) {
// app was launched by tapping a notification
}

Create a notification from Lovable’s chat

Notify users when they receive a new direct message.
The messages table has a recipient_id that maps to the users table.
Title: "New message from {{users.name}}"
Body: "{{messages.content}}"
Send a push notification when a task is assigned to a user.
The tasks table has an assigned_to column that is the user ID.
Title: "New task assigned"
Body: "{{tasks.title}} is due {{tasks.due_date}}"

Managing notifications

From Lovable’s chat you can also:

List all my Entrig notifications
Update the welcome email - change the subject to "Welcome to {{users.name}}"
Delete the order shipped notification

Next steps