Skip to content

uraiai/cloudflare-message-handler

Repository files navigation

Message Handler

A Cloudflare Worker that handles incoming Twilio messages by triggering a URAI callout.

Overview

This worker is designed to be used as a webhook for Twilio. When a POST request is received:

  1. It parses the incoming From, To, and Body fields from the form data.
  2. It makes an authorized POST request to the URAI Voice API to initiate a callout to the sender.
  3. The original SMS body is passed to URAI as metadata.

Configuration

The worker requires several environment variables defined in wrangler.jsonc or as secrets:

  • URAI_ORG_ID: Your URAI Organization ID.
  • URAI_AGENT_ID: The URAI Agent ID.
  • URAI_API_KEY: Your URAI API secret key (should be added via wrangler secret put).

Development

Start the development server:

npm run dev

Deployment

Deploy the worker to Cloudflare:

npm run deploy

To regenerate type definitions for the environment:

npm run cf-typegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors