SDKs
Twilic has production-ready implementations in eighteen languages. The current published SDK line targets v2 payloads and shares a consistent API surface; the current specification family is v3.
Documentation
| Resource | Description |
|---|---|
| API Reference | Complete function signatures for JS, Rust, Python, Go |
| Integrations | HTTP packages for Hono, Express, Fastify, Fetch, Axios |
| Encoding Profiles | Dynamic, Batch, Bound, Stateful |
| Quick Start | Install and first encode in every language |
Available SDKs
| Language | Package | Requirements |
|---|---|---|
| Rust | twilic (crates.io) | Rust stable (edition 2024) |
| Go | github.com/twilic/twilic-go | Go 1.22+ |
| Python | twilic (PyPI) | Python 3.12+ |
| JavaScript / TypeScript | @twilic/core | Node.js 24+ / WASM |
| Java | io.twilic | Java 21+ |
| Scala | io.twilic (GitHub) | Java 21+ / Scala 3.3+ |
| Ruby | twilic (RubyGems) | Ruby 3.3+ |
| R | twilic (GitHub) | R 4.4+ |
| Zig | twilic (build.zig.zon) | Zig 0.15.2+ |
| PHP | twilic/twilic (GitHub) | PHP 8.3+ |
| Kotlin | io.twilic:twilic (GitHub) | JDK 21+ |
| Dart | twilic (GitHub) | Dart SDK 3.5+ |
| Elixir | :twilic (GitHub) | Elixir 1.19+ / OTP 27+ |
| Lua | twilic (GitHub / LuaRocks) | Lua 5.4 |
| C | twilic-c (GitHub) | CMake 3.16+ / C11 |
| C++ | twilic-cpp (GitHub) | CMake 3.16+ / C++17 |
| C# | Twilic (GitHub) | .NET 8 SDK |
| Swift | Twilic (SPM) | Swift 5.9+ |
Common API Surface
All SDKs expose the same logical operations:
| Operation | Description | Reference |
|---|---|---|
encode(value) | Dynamic profile encode | Profiles |
decode(bytes) | Decode to value | Errors & Limits |
encode_with_schema(value, schema) | Bound profile encode | Schema-Bound |
encode_batch(records) | Same-shape batch | Batch & Columnar |
SessionEncoder | Stateful stream encoder | Session Encoder |
JavaScript entrypoints
| Import | Use |
|---|---|
@twilic/core | init, encode, decode, createSessionEncoder |
@twilic/core/advanced | encodeBatch, encodeWithSchema, transport-JSON |
See JavaScript Core API and Advanced API.
Rust (Reference Implementation)
The JavaScript SDK is built on the Rust implementation via N-API and WASM. Full low-level API: Rust reference.
Interoperability
All published SDKs are tested against shared binary fixtures. Any v2 encoder output decodes in any v2 SDK. See Interop guide.