npm install
npm run devnpm run deployFor generating/synchronizing types based on your Worker configuration run:
npm run cf-typegenPass the CloudflareBindings as generics when instantiation Hono:
// src/index.ts
const app = new Hono<{ Bindings: CloudflareBindings }>()- D1 schema lives in
drizzle/0000_inbox.sqlandsrc/db/schema.ts. Apply it withwrangler d1 migrations applyafter wiring theINBOX_DBbinding. - The worker exposes
/seal,/send,/sync, and/ackundersrc/routes/inbox. - Secrets required by the worker:
PUSH_SECRET: AES-256 key used to seal/unseal device tokens (base64, hex, or raw string).APPLE_P8_KEY: Base64-encoded or plain PKCS#8.p8contents.APPLE_TEAM_ID,APPLE_KEY_ID,APNS_TOPIC, optionalAPNS_HOST.
- Configure the cron trigger in
wrangler.jsoncto keep the inbox table clean (24h TTL).