@teleads/sdk-node
v0.1.3
Published
TeleAds SDK
Readme
TeleAds SDK
This repository holds SDK related to TeleAds.
Requirements
- node.js 20+
Installation
Install the latest version with
npm i @teleads/sdk-nodeUsage
SDK accepts single update from the Telegram bot as an object.
Basic usage
import { BAP } from '@teleads/sdk-node'
const bap = new BAP('<sdk_token>')
bap.handleTelegramUpdates(update)If your advertisement mode is set to manual you can mark ad placement in your code by calling:
bap.advertisement(update)Interrupting control flow
At times, SDK may introduce telegram updates within its advertisement flow. To maintain the logical consistency of your bot, it is necessary to ignore such updates.
The BAP::handleTelegramUpdates method returns a boolean value indicating whether you should proceed with handling the request or skip it as an internal SDK request.
When the method returns false, it signifies that the current request should not be processed by your bot.
SDK Key
The SDK Key is generated immediately after connecting your Telegram Bot in TeleAds.
You can find more information on the platform configuration here.
About
Submitting bugs and feature requests
Bugs and feature request are tracked on GitLab
License
TeleAds SDK is licensed under the MIT License - see the LICENSE file for details
