TDLib (Telegram Database Library) is a cross-platform client library for Telegram. It handles networking, encryption, and local storage so custom apps can be built from many programming languages.
Overview
TDLib is the Telegram Database Library, a cross-platform library intended for third-party developers who want custom applications on the Telegram platform. It presents a fully functional Telegram client as a library rather than a standalone end-user app.
The library abstracts network details, encryption, and on-device data storage. It is fully asynchronous, with ordered delivery of updates, stability on unreliable connections, and local data encrypted using a user-supplied key. Interfaces include C++, JSON, Java through JNI, and .NET through C++/CLI or C++/CX, with JSON recommended for languages that can call C functions.
Developers integrate TDLib into CMake, Java, .NET, or other stacks via static or JSON bindings. API methods and classes are documented through a machine-readable scheme and generated HTML documentation. JSON interface versions with the same major number are binary compatible across minor releases.
TDLib is the foundation for custom mobile, desktop, and embedded Telegram clients, leaving UI and product logic to the application that embeds the library.
Key features
- Encrypted local data storage
- Fully asynchronous API
- Ordered update delivery
- JSON, C++, Java, and .NET interfaces
- Cross-platform operating system support
- Documented tdapi method scheme
- Network and encryption handled internally
- Multi-language bindings via JSON C API
Use cases
- Custom Telegram client applications
- Bots and automation using TDLib
- Embedded Telegram on niche platforms
- Cross-language Telegram integrations
- Desktop or mobile messengers on Telegram