func.toml to an authenticated resource handle, resolved by the runtime — the credential is injected for you and never appears in your code, bundle, or logs.
Each binding resolves on the env object (from @telnyx/edge-runtime) — env.MY_TELNYX, env.SECRETS, and so on.
The
env object and telnyx-edge types are TypeScript-only today. Other runtimes (js, go, python, quarkus) don’t get the typed env handle, but reach the same resources through the credentials injected into the container — see Bindings from other languages.Every binding works the same way
MY_TELNYX) is yours to choose; it becomes the property on env. telnyx-edge types writes telnyx-env.d.ts from the manifest — re-run it after every binding change. Typing for [storage.kv.<name>] blocks requires CLI v0.2.3 or later.
The SDK types
.data as T | undefined for list calls. Under tsc --strict, indexing into data (e.g. data.length) fails with TS18048: 'data' is possibly 'undefined'. Coalesce before use: const arr = list.data ?? [];.Catalogue
Manifest: func.toml or telnyx.toml
Bindings are declared in your project manifest. telnyx-edge types reads either form and types env.<binding> for each declared binding.
func.toml(classic) — the standard[edge_compute]project file. Can declare[telnyx],[[secrets]],[storage.kv.<name>], and[storage.cloudstorage.<name>].telnyx.toml(umbrella) — a manifest with top-levelnameandmain. Declares the same bindings, plus[[actors]]— actor classes are imported frommain, which is why actors require the umbrella form.
Bindings from other languages
Theenv SDK surface is TypeScript-only, but the credentials behind it are not:
- Telnyx API — declaring
[telnyx]also injects aTELNYX_API_KEYenvironment variable into the container at runtime. Any language can call the Telnyx REST API with it as a bearer token — see Using the Telnyx API. - Secrets — every secret is also injected as a plain environment variable into all your functions (
os.environ["DEMO_GREETING"],os.Getenv("DEMO_GREETING"), …).env.SECRETS.get()and the environment variable are two views of the same value. - KV — any language can use the KV REST API with the injected
TELNYX_API_KEY. - Object storage — the typed
envbinding is TypeScript only; from any language, reach the same buckets over the S3-compatible API with your own access keys. - Stateful Actors — TypeScript only; there is no REST fallback today.
Bindings vs secrets
- Binding — a Telnyx or platform resource, authenticated for you (
env.MY_TELNYX). - Secret — a value you supply (
env.SECRETS.get("STRIPE_KEY")).
Next Steps
- Telnyx API quick start — declare
[telnyx]and make your first authenticated call - KV quick start — create a namespace, bind it, read and write
- Object storage binding — bind a bucket and read, write, and list objects from
env - Secrets — add, rotate, and access secrets
- Stateful Actors — per-entity state and coordination