Skip to content

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

ResourceDescription
API ReferenceComplete function signatures for JS, Rust, Python, Go
IntegrationsHTTP packages for Hono, Express, Fastify, Fetch, Axios
Encoding ProfilesDynamic, Batch, Bound, Stateful
Quick StartInstall and first encode in every language

Available SDKs

LanguagePackageRequirements
Rusttwilic (crates.io)Rust stable (edition 2024)
Gogithub.com/twilic/twilic-goGo 1.22+
Pythontwilic (PyPI)Python 3.12+
JavaScript / TypeScript@twilic/coreNode.js 24+ / WASM
Javaio.twilicJava 21+
Scalaio.twilic (GitHub)Java 21+ / Scala 3.3+
Rubytwilic (RubyGems)Ruby 3.3+
Rtwilic (GitHub)R 4.4+
Zigtwilic (build.zig.zon)Zig 0.15.2+
PHPtwilic/twilic (GitHub)PHP 8.3+
Kotlinio.twilic:twilic (GitHub)JDK 21+
Darttwilic (GitHub)Dart SDK 3.5+
Elixir:twilic (GitHub)Elixir 1.19+ / OTP 27+
Luatwilic (GitHub / LuaRocks)Lua 5.4
Ctwilic-c (GitHub)CMake 3.16+ / C11
C++twilic-cpp (GitHub)CMake 3.16+ / C++17
C#Twilic (GitHub).NET 8 SDK
SwiftTwilic (SPM)Swift 5.9+

Common API Surface

All SDKs expose the same logical operations:

OperationDescriptionReference
encode(value)Dynamic profile encodeProfiles
decode(bytes)Decode to valueErrors & Limits
encode_with_schema(value, schema)Bound profile encodeSchema-Bound
encode_batch(records)Same-shape batchBatch & Columnar
SessionEncoderStateful stream encoderSession Encoder

JavaScript entrypoints

ImportUse
@twilic/coreinit, encode, decode, createSessionEncoder
@twilic/core/advancedencodeBatch, 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.

Released under the CC-BY-4.0 License.