For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add Push Notification Support

Ask Replit's agent to add Twinr push notifications, and finish the setup in your dashboard.

Push notifications need two halves: your app asks Twinr for a device token and stores it, and Twinr sends to that token later.

Ask the agent

With the MCP server connected, ask Replit:

Add Twinr push notifications to my app. Use the Twinr MCP tools to get what you need.

The agent fetches Twinr's push guide and writes the code.

Answer the agent's question

It will ask who your notifications are for:

  • Everyone — every device that opens your app can receive a notification. No sign-in needed.

  • Specific people — notifications aimed at one user. This needs sign-in and somewhere to store each person's device token, so the agent will add those if your project lacks them.

What the code does

The agent adds a call to twinr_push_token_fetch(), which asks the app for the device's push token. The call is guarded, so in an ordinary browser it does nothing and your site is unaffected.

If you chose per-user notifications, it stores the token against the signed-in user so you can send to that person later.

Finish in the Twinr dashboard

Code alone does not switch push on. Enable push notifications for your app in Twinr — see Push.

Until that is done your app requests a token and gets nothing back, which is the usual reason push appears not to work after the code is in place.

Test it

  1. Build your app and install it on a real device — push does not work in a browser or the previewer.

  2. Open the app and let it register.

  3. Send a test notification from Twinr.

Last updated