Getting Started
Here’s how to start sending Web Push notifications with todoke.
Three Ways to Use It
Section titled “Three Ways to Use It”todoke offers three ways to use it depending on your needs.
| Method | Shortest path | Details page |
|---|---|---|
| Dashboard | Sign up and log in from your browser, then create apps / check subscription status / view statistics from the UI | Account registration and login |
| CLI | todoke login → todoke notify | CLI |
| API / SDK | Issue an API key and call POST /api/v1/notify (covered on this page) | This page / TypeScript SDK |
The shortest CLI path is as follows (assuming you are already logged in with a full scope key).
todoke login --api-key pk_full_keytodoke notify <app-id> -t "Test notification" -b "Sent successfully!"# Note: <app-id> is not referenced in the current implementation; the destination is# determined by the app associated with the logged-in keyThe quick start below covers the dashboard and API / SDK workflows.
Quick Start
Section titled “Quick Start”-
Create an account
Visit the todoke dashboard and sign up with your email and password, or log in with your GitHub account.
-
Create an app
Click “Create New App” in the dashboard and enter an app name. A VAPID public key will be automatically generated.
-
Issue an API key
Create a key in the “API Keys” section of the app detail screen. Choose a scope that matches your use case.
subscribe_only— For embedding in the frontend (subscription registration only)notify— For sending notifications from the server sidefull— Management key that allows all operations
-
Implement subscription registration in the frontend
Use the VAPID public key and
subscribe_onlykey to register subscriptions from the browser.import { PushCF } from "@todoke/sdk";const client = new PushCF({apiKey: "pk_subscribe_only_key",});const registration = await navigator.serviceWorker.ready;await client.subscribe({ registration }); // Register Push subscription -
Send a notification
Send a notification from the server side using a
notifyscope key.Terminal window curl -X POST https://api.todoke.dev/api/v1/notify \-H "Authorization: Bearer pk_notify_key" \-H "Content-Type: application/json" \-d '{"title":"Test Notification","body":"Sent successfully!"}'
Next Steps
Section titled “Next Steps”- Account registration and login — How to operate the dashboard
- CLI — How to operate from the terminal
- App Management — How to check VAPID keys and statistics
- Push Subscription — Frontend implementation details
- Sending Notifications — Bulk and individual sending methods
- API Keys — Scopes and management
- TypeScript SDK — Installing and using the SDK