{"id":20514499,"url":"https://github.com/alexxandergrib/node-tdlib","last_synced_at":"2025-04-14T00:13:30.441Z","repository":{"id":65768204,"uuid":"569781005","full_name":"AlexXanderGrib/node-tdlib","owner":"AlexXanderGrib","description":"TDLib cross platform API","archived":false,"fork":false,"pushed_at":"2025-03-29T08:52:11.000Z","size":853070,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T00:13:14.579Z","etag":null,"topics":["tdlib","telegram","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexXanderGrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T15:45:20.000Z","updated_at":"2025-03-29T08:39:44.000Z","dependencies_parsed_at":"2025-03-06T16:58:59.114Z","dependency_job_id":null,"html_url":"https://github.com/AlexXanderGrib/node-tdlib","commit_stats":{"total_commits":142,"total_committers":2,"mean_commits":71.0,"dds":0.007042253521126751,"last_synced_commit":"c23efbdbb4aaeaaef33741404c071dd24e0f7d72"},"previous_names":["alexxandergrib/node-tdlib","tdlib-native/tdlib-native"],"tags_count":18,"template":false,"template_full_name":"AlexXanderGrib/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fnode-tdlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fnode-tdlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fnode-tdlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexXanderGrib%2Fnode-tdlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexXanderGrib","download_url":"https://codeload.github.com/AlexXanderGrib/node-tdlib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799956,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["tdlib","telegram","typescript"],"created_at":"2024-11-15T21:16:53.981Z","updated_at":"2025-04-14T00:13:30.429Z","avatar_url":"https://github.com/AlexXanderGrib.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TDLib Native\n\n\u003e Cross platform TDLib wrapper\n\n\u003cimg src=\"https://alexxandergrib.github.io/node-tdlib/icons/tdlib-native-logo.svg\" align=\"right\"\n     alt=\"Logo\" width=\"96\" height=\"96\"\u003e\n\n[![Test Status](https://github.com/AlexXanderGrib/node-tdlib/actions/workflows/test.yml/badge.svg)](https://github.com/AlexXanderGrib/node-tdlib)\n[![Downloads](https://img.shields.io/npm/dt/tdlib-native.svg)](https://npmjs.com/package/tdlib-native)\n[![last commit](https://img.shields.io/github/last-commit/AlexXanderGrib/node-tdlib.svg)](https://github.com/AlexXanderGrib/node-tdlib)\n[![codecov](https://img.shields.io/codecov/c/github/AlexXanderGrib/node-tdlib/main.svg)](https://codecov.io/gh/AlexXanderGrib/node-tdlib)\n[![GitHub](https://img.shields.io/github/stars/AlexXanderGrib/node-tdlib.svg)](https://github.com/AlexXanderGrib/node-tdlib)\n[![tdlib-native](https://snyk.io/advisor/npm-package/tdlib-native/badge.svg)](https://snyk.io/advisor/npm-package/tdlib-native)\n[![Known Vulnerabilities](https://snyk.io/test/npm/tdlib-native/badge.svg)](https://snyk.io/test/npm/tdlib-native)\n[![npm](https://img.shields.io/npm/v/tdlib-native.svg)](https://npmjs.com/package/tdlib-native)\n[![license MIT](https://img.shields.io/npm/l/tdlib-native.svg)](https://github.com/AlexXanderGrib/node-tdlib/blob/main/LICENSE.txt)\n[![Size](https://img.shields.io/bundlephobia/minzip/tdlib-native)](https://bundlephobia.com/package/tdlib-native)\n\n## Why use this package?\n\n- **Fast.** `TDLib` is a fastest way to interact with Telegram on NodeJS. It's written in C++ with optimized network stack and caching.\n- **Better DX.** Easy, well documented API. Instant type completion\n  ```typescript\n  /**\n   * Sends a message. Returns the sent message\n   *\n   * @throws {TDError}\n   * @param {sendMessage$DirectInput} parameters {@link sendMessage$Input}\n   * @returns {Promise\u003cMessage\u003e} Promise\u003c{@link Message}\u003e\n   */\n  async sendMessage(parameters: sendMessage$DirectInput): Promise\u003cMessage\u003e\n  ```\n- **Secure.**\n  - Only 3 dependencies: `node-addon-api`, `debug`, `detect-libc`\n  - Built on CI with provenance\n- **Multi-Platform.** Supported platforms:\n  - Linux: x64, arm64 (glibc, musl)\n  - Android: arm64 (glibc, musl)\n  - MacOS: x64, Apple Silicon (arm64)\n  - Windows: x64, x32\n\n## 📦 Installation\n\n- **Using `npm`**\n  ```shell\n  npm i tdlib-native\n  ```\n- **Using `Yarn`**\n  ```shell\n  yarn add tdlib-native\n  ```\n- **Using `pnpm`**\n  ```shell\n  pnpm add tdlib-native\n  ```\n\n## 3.0 Changelog\n\n- Made builds for linux arm64\n- Made builds for musl libc\n- Made builds for windows x32 (since tg desktop supports it)\n- Fixed client thread safety, fixed disposal of tdlib clients\n- Made `client.start()`, `client.pause()` and `client.destroy()` - async\n- Upgraded TDLib to 1.8.37\n\n## ⚙️ Usage\n\nThis is raw wrapper of TDLib\n\n```typescript\nimport { Client, Authenticator } from \"tdlib-native\";\nimport { TDLibAddon } from \"tdlib-native/addon\";\n\nasync function init() {\n  // Loading addon\n  const adapter = await TDLibAddon.create();\n\n  // Make TDLib shut up. Immediately\n  Client.disableLogs(adapter);\n\n  const client = new Client(adapter);\n  const authenticator = Authenticator.create(client)\n    .tdlibParameters({\n      /* options */\n    })\n    .token(process.env.TELEGRAM_BOT_TOKEN);\n\n  // Start polling responses from TDLib\n  // And authenticate bot\n  // THIS SHOULD BE USED via Promise.all\n  // OR ELSE .authenticate() skips an update and hangs\n  await Promise.all([client.start(), authenticator.authenticate()]);\n\n  // client authorized as bot\n  // Call any tdlib method\n  await client.api.getOption({ name: \"version\" });\n  // =\u003e Promise { _: \"optionValueString\", value: \"1.8.37\" }\n\n  // or use a wrapper\n  await client.tdlibOptions.get(\"version\");\n  // =\u003e Promise \"1.8.22\"\n\n  // Subscribe to updates\n  client.updates.subscribe(console.log);\n\n  // Pause receiving updates. Will freeze method all running API calls\n  // await client.pause();\n  // Resume pause\n  // await client.start();\n\n  // Destroy\n  await client.api.close({});\n  await client.destroy();\n}\n```\n\n**Usage with RxJS**\n\n```typescript\n// Observable will complete after client.destroy() call\nconst updates = new Observable(client.updates.toRxObserver());\n```\n\n### Projects built with `tdlib-native`\n\n\u003ctable\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"center\" valign=\"top\" width=\"11%\"\u003e\n\u003ca href=\"https://t.me/guardcore_bot\"\u003e\n\u003cimg\nsrc=\"https://alexxandergrib.github.io/node-tdlib/icons/guardcore-bot.jpg\"\nwidth=\"75\"\nheight=\"75\"\nalt=\"GuardCore Bot's Avatar\"\n/\u003e\u003cbr /\u003e\nGuardCore Bot\n\u003c/a\u003e\n\u003c/td\u003e\u003ctd align=\"center\" valign=\"top\" width=\"11%\"\u003e\n\u003ca href=\"https://t.me/tvoya_statya_bot\"\u003e\n\u003cimg\nsrc=\"https://alexxandergrib.github.io/node-tdlib/icons/tvoya-statya-bot.jpg\"\nwidth=\"75\"\nheight=\"75\"\nalt=\"Твоя Статья УК РФ's Avatar\"\n/\u003e\u003cbr /\u003e\nТвоя Статья УК РФ\n\u003c/a\u003e\n\u003c/td\u003e\u003ctd align=\"center\" valign=\"top\" width=\"11%\"\u003e\n\u003ca href=\"https://github.com/AlexXanderGrib/node-tdlib/issues/new\"\u003e\n\u003cimg\nsrc=\"https://alexxandergrib.github.io/node-tdlib/icons/add.png\"\nwidth=\"75\"\nheight=\"75\"\nalt=\"\"\n/\u003e\u003cbr /\u003e\nAdd your project\n\u003c/a\u003e\n\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\n\n## Credits\n\nThis package is based on [eilvelia/tdl](https://github.com/eilvelia/tdl)\n\nLicenses:\n\n- C++ addon - [MIT](./docs/licenses/addon.license.txt)\n- Ci pipeline - [Blue Oak Model License 1.0.0](./docs/licenses/ci.license.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexxandergrib%2Fnode-tdlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexxandergrib%2Fnode-tdlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexxandergrib%2Fnode-tdlib/lists"}