func.toml; the runtime resolves it to env.<BINDING> and injects the credential — your code holds no access key or secret key, and nothing sensitive appears in your bundle or logs.
The handle is a small, focused surface — get, put, head, delete, list. It is the in-function counterpart of the S3-compatible API: same buckets, same objects, reached from inside a function instead of over HTTP.
Cloud Storage bindings are TypeScript-only — the typed
env handle comes from the @telnyx/edge-runtime SDK (≥ 0.5.0). Other runtimes (JS, Go, Python) don’t get a typed binding.PUT, GET, and DELETE an object by key, and list objects by prefix.
1. Scaffold the function
Create a TypeScript function. You also need an existing bucket for it to use — the binding points at a bucket, it doesn’t create one. If you don’t have one, create it first via the Mission Control portal, the AWS CLI, or an S3 SDK.2. Declare the binding
Add a[storage.cloudstorage.<name>] block to the generated func.toml. The block key is a name you choose — it becomes the property on env. Here it’s ASSETS, reached as env.ASSETS:
[storage.cloudstorage.<name>] becomes env.<name>.
3. Install and generate types
new-func already lists @telnyx/edge-runtime and @aws-sdk/client-s3 in package.json. Install them, then generate the typed env:
telnyx-edge types writes telnyx-env.d.ts, which types env.ASSETS as CloudStorageBucket so the calls below type-check.
4. Write the function
Replaceindex.ts with the complete file API. Every bucket operation — list, put, get, delete — goes through env.ASSETS; there are no credentials anywhere in the code.
5. Ship it
6. Try it
WithURL set to your function’s invoke URL:
Beyond the basics
This file API sticks to the coreget/put/delete/list calls. The same binding also does ranged and conditional reads, batch delete, hierarchical (folder) listing, multipart uploads for objects past the request/response size cap, and SSE‑C customer-key encryption — all on env.<BINDING>. See the Binding API reference for every method, option, and object type.
Related
- Binding API reference — every method, option, and object type
- Bindings overview — how bindings work across Telnyx API, Secrets, KV, and Cloud Storage
- S3-compatible quick start — the same buckets over HTTP