Skip to content

jkpe/workers-whatsapp-transcription

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Voice Transcription

Cloudflare Worker that transcribes WhatsApp voice messages using Workers AI (Whisper) and replies with the transcript. Optional AI summary via GENERATE_SUMMARY.

Setup

  1. Meta / WhatsApp

    • Create a Meta app and add the WhatsApp product.
    • Get your Phone Number ID and Access Token.
    • Configure a webhook URL: https://<your-worker>.<account>.workers.dev/webhook.
    • Set a verify token (any string you choose).
  2. Secrets (required):

    npx wrangler secret put WEBHOOK_SECRET      # same as verify token in Meta
    npx wrangler secret put WHATSAPP_PHONE_NUMBER_ID
    npx wrangler secret put WHATSAPP_ACCESS_TOKEN
  3. Optional

    • WHITELISTED_PHONE_NUMBERS — comma-separated numbers; if set, only these receive transcript replies. Omit to allow all.
    • In wrangler.jsonc vars: GENERATE_SUMMARY (true/false), WORKERS_AI_MODEL, WORKERS_AI_SUMMARY_MODEL.

Deploy

npm install
npm run deploy

Use the worker URL as your WhatsApp webhook and for verification.

Endpoints

  • POST /webhook — WhatsApp webhook (receives events).
  • GET /webhook — Verification (Meta sends hub.mode, hub.verify_token, hub.challenge).
  • GET /health — Returns OK.

About

Cloudflare Worker that transcribes WhatsApp voice messages using Workers AI and replies with the transcript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors