# @kody/twilio Official Twilio four-dot mark (Simple Icons path of [Twilio's logo](https://www.twilio.com)) in Signal Red `#F22F46`. Twilio® is a trademark of Twilio Inc. This package is not affiliated with or endorsed by Twilio. Share this package as https://kody.codes/@kody/twilio (never a `/community/{listing_id}` URL). ## Intent Provide reusable, account-agnostic Twilio helpers so Kody can look up the caller's account, list incoming numbers, read message logs, and send SMS. Auth is a saved Account SID plus Auth Token. Sends **default to dry-run** and need `confirm: true` for a live message. No personal phone numbers belong in this package — pass `from`/`to` or a Messaging Service SID at call time. This listing is meant to be forked. The live `@kody/twilio` package does not talk to a shared Twilio account. ## What it does - Look up the caller's Twilio account profile (never returns `auth_token`) - List incoming phone numbers and recent SMS/MMS logs - Preview or send SMS (`send-message` defaults to dry-run) - Optionally store a Messaging Service SID in forked `packageStorage()` - Call uncommon 2010-04-01 Account paths through `./request` ## Prerequisites / setup **Account SID + Auth Token** (secret-backed HTTP Basic). There is no Twilio OAuth integration and no baked-in sender. Do not open `/connect/oauth` for Twilio. | Secret | Purpose | | --- | --- | | `twilioAccountSid` | Account SID (`AC…`) used as the Basic username and in the REST path | | `twilioAuthToken` | Auth Token used as the Basic password | Optional readable default (not a secret): store a Messaging Service SID (`MG…`) in this package's `packageStorage()` after you fork. Live `@kody/twilio` storage is the platform bucket — fork first. 1. Copy the Account SID and Auth Token from the [Twilio Console](https://console.twilio.com). Never paste them into chat. 2. Save the Account SID: https://kody.codes/account/secrets/new?name=twilioAccountSid&description=Twilio%20Account%20SID%20(AC...)&allowedHosts=api.twilio.com&scope=user 3. Save the Auth Token: https://kody.codes/account/secrets/new?name=twilioAuthToken&description=Twilio%20Auth%20Token&allowedHosts=api.twilio.com&scope=user 4. Approve host **`api.twilio.com`** for both secrets. ### Additional accounts Pass `account: "work"` to use `twilioAccountSid-work` / `twilioAuthToken-work`, or pass `accountSidSecret` / `authTokenSecret` explicitly. https://kody.codes/account/secrets/new?name=twilioAccountSid-work&description=Twilio%20Account%20SID%20(AC...)&allowedHosts=api.twilio.com&scope=user https://kody.codes/account/secrets/new?name=twilioAuthToken-work&description=Twilio%20Auth%20Token&allowedHosts=api.twilio.com&scope=user Agents: see [`AGENTS.md`](./AGENTS.md) for import paths, smoke checks, and mutation guards. ## Done when - `twilioAccountSid` and `twilioAuthToken` are saved; host `api.twilio.com` is approved - Smoke test returns `ok: true` (live account + numbers/logs sample when secrets exist; never sends SMS) - `send-message` previews by default; live sends need `confirm: true` plus `from` or a Messaging Service SID - No personal phone numbers are baked into the package ## Branding Keep `LICENSE` (MIT), `## Intent`, and `community-icon.svg` intact for community listing. ## Docs - [Twilio REST API](https://www.twilio.com/docs/usage/api) - [Accounts](https://www.twilio.com/docs/iam/api/account) - [IncomingPhoneNumbers](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) - [Messages](https://www.twilio.com/docs/sms/api/message-resource)