Introducing Prelay

An encrypted notification relay for Android. Run it yourself or use the zero-knowledge hosted service, and send from any script or server with one request.

1 min read

Prelay is available now, as a self-hosted server and as a hosted service.

It is a notification relay for Android. Any script, server, cron job, or monitoring system can send a notification to your phone with one HTTP request. You run the relay, or use the hosted version, and the Android app receives the message.

No SDK. No mobile push infrastructure to build. No notification vendor reading the contents.

What it does

The API is deliberately small. On a self-hosted relay in the default Mode A, send a request with a title and message:

Terminal window
curl -X POST https://relay.example.com/v1/notify \
-H "Authorization: Bearer $PRELAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title":"Deploy failed","message":"Production is down.","priority":"high"}'

Prelay handles device registration, authentication, encryption, and delivery through Firebase Cloud Messaging. The Android app receives the encrypted envelope, decrypts it on the device, and posts a local notification.

That is the whole integration. If a tool can make an HTTP request, it can send a Prelay notification.

This plaintext request is the self-hosted Mode A path. On Cloud, encryption happens before the request leaves your machine; the hosted API accepts only the resulting encrypted envelope.

Why another notification service?

Sending a notification to your own phone is harder than it should be. The usual options are a proprietary push service, a vendor SDK, or building and maintaining mobile push infrastructure yourself.

Those options also tend to ask for more than the job requires: message contents, device identifiers, delivery history, analytics, or a permanent account with a third party.

Prelay takes a narrower approach. The server is self-hostable, the API is plain HTTP, and the data model is intentionally minimal. The relay does not keep message history, run analytics, or build a profile of your devices.

How it works

  1. Install the Android app and register a device with your relay.
  2. Send a POST /v1/notify request with a token.
  3. The relay prepares the encrypted envelope and hands it to FCM.
  4. FCM delivers the envelope to the app. The phone decrypts it and shows the notification.

FCM is transport only. It receives an encrypted envelope, not the message. The same is true of the relay in zero-knowledge mode.

Two encryption modes

Prelay supports two ways to encrypt a notification.

Mode A, server-assisted encryption. This is the default for self-hosted deployments. Your script sends the message to your relay over HTTPS, and the relay encrypts it to the device’s public key before forwarding it. This is the simpler mode, and it trusts the server you run.

Mode B, sender-encrypted. The sender encrypts the message before the request leaves the machine. The relay only routes ciphertext and cannot read the contents. Prelay Cloud accepts Mode B only.

In both modes, the phone holds the private key and performs the final decryption. The cryptographic details are in the protocol documentation.

Run it yourself

The self-hosted server is a single Docker container with SQLite by default:

Terminal window
git clone https://codeberg.org/prelay/prelay.git
cd prelay
docker compose up --build -d
docker compose exec prelay-server /app/prelayd admin-token

Then install the Android app from the releases page, enter your server URL, paste the token, and register the device. A single prebuilt APK works with any server; there is no per-server app build.

One external dependency is Firebase. Each deployment uses its own Firebase project for push delivery, configured with PRELAY_FCM_CREDENTIALS and PRELAY_FCM_GOOGLE_SERVICES. Without those, the server accepts requests but cannot deliver them. The deployment guide covers the setup.

The CLI

The Android app is one half of the client story. The other is prelay, a small command-line client that sends notifications and manages a server. Prebuilt binaries ship with every release, and the CLI can also be built from the repository.

For self-hosted Mode A, it is a convenience wrapper around the API:

Terminal window
prelay send --server https://relay.example.com --token "$PRELAY_TOKEN" \
--title "Deploy failed" --message "Production is down."

For zero-knowledge Mode B, the CLI does the part that curl cannot do on its own. It fetches the device public key, encrypts the notification on your machine, and sends only the envelope:

Terminal window
prelay send --server https://api.prelay.sh --token "$PRELAY_TOKEN" \
--encrypted --device 0193f8e2-... \
--title "Deploy failed" --message "Production is down."

The same binary works against self-hosted and Cloud. It can also list devices, create scoped tokens, and generate keypairs, which makes it useful for setup and CI. Set the server and token once; the config file is created with 0600 permissions:

Terminal window
prelay config set server=https://api.prelay.sh token="$PRELAY_TOKEN"

The CLI reference has the full command set.

Prelay Cloud

Prelay Cloud is the hosted version of the same server. You get the same API, the same Android app, and a web dashboard for account, devices, tokens, usage, and billing. You do not run a container, a database, or a Firebase project.

The trade is deliberate: Cloud is zero-knowledge only. It accepts Mode B, where the sender encrypts before the request leaves the machine, so the hosted relay only routes ciphertext. It does not accept raw title/message requests. The CLI exists to make that encrypted path usable from a script; the dashboard cannot display notification contents because it never has them.

Plans are Solo, Pro, and Team. They differ in notification volume, device count, and dashboard seats; every plan has the same encryption and API features. Team plans also let members share device and token management. New accounts start with a 14-day Pro trial, then convert to a paid plan. Self-hosted Prelay remains free, open source, and unlimited.

You can create a Cloud account or read the Cloud setup guide.

Pricing

The two smallest Cloud plans:

PlanPrice (EUR)Notifications / monthDevicesDashboard seats
Solo€5/mo or €48/yr30021
Pro€12/mo or €115/yr30,000153

Every plan includes the same zero-knowledge encryption, API features, and Android app. The tiers differ in scale, not in security.

What it is not

Prelay is not a chat app, an email replacement, an analytics platform, or a full incident-management system. It is a narrow path from a system that has something to say to an Android phone that should show it.

Android is the only supported platform today.

Source, releases, and documentation: