Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyPush

A tiny Web Push service for iPhone and iPad.

Send a POST request, get a notification on your phone.

TinyPush runs on Cloudflare Workers and stores one push subscription in KV.

It only supports iPhone and iPad.

Setup

Install dependencies and log in to Cloudflare:

npm install
npx wrangler login

Create a KV namespace:

npx wrangler kv namespace create PUSH

Put the returned ID in wrangler.toml:

[[kv_namespaces]]
binding = "PUSH"
id = "YOUR_KV_ID"

Generate the token and VAPID keys:

npm run secrets

Then add them to the Worker:

npx wrangler secret put TOKEN
npx wrangler secret put VAPID_PUBLIC_KEY
npx wrangler secret put VAPID_PRIVATE_KEY

Deploy:

npm run deploy

Connect your iPhone or iPad

Open the deployed URL in Safari.

Add it to the Home Screen, open it from there, enter your token, then tap Enable notifications.

That is all you need to do on the phone.

Send a notification

curl https://YOUR-WORKER.workers.dev/api/send \
  -X POST \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Hello","body":"This is a test"}'

Windows CMD:

curl https://YOUR-WORKER.workers.dev/api/send -X POST -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" -d "{\"title\":\"Hello\",\"body\":\"This is a test\"}"

Notes

TinyPush keeps only one subscription.

If you connect another device, the old subscription is replaced.

There are no accounts, device lists, dashboards, or notification history.

License

MIT

About

This is a minimalistic tool to send notifications to your iPhone or iPad with a simple HTTP request by using Cloudflare Workers.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages