Skip to main content
A binding maps a name you declare in 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

The binding name (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-level name and main. Declares the same bindings, plus [[actors]] — actor classes are imported from main, which is why actors require the umbrella form.

Bindings from other languages

The env SDK surface is TypeScript-only, but the credentials behind it are not:
  • Telnyx API — declaring [telnyx] also injects a TELNYX_API_KEY environment 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 env binding 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")).
Use a binding for platform resources; use a secret for your own third-party credentials.

Next Steps