
Add reusable features with libraries
Choose a Bots.Business library, install it for the right bot, and check its exact BJS name before use.
A library exposes reusable BJS functions. Use one when it solves a specific task: tracking referrals, checking channel membership, receiving a webhook, or connecting a service.
Choose a library
ResLib, RefLib, CommonLib, TopBoardLib, CurrencyQuote, CryptoJS and the Smart classes are provided by the runtime; no Store installation is needed for these objects.
Short names for core libraries
Libs.ResourcesLib
ResLib
Libs.ReferralLib
RefLib
Libs.CommonLib or Libs.commonLib
CommonLib
These compatibility names refer to the same core objects, so the shorter names use the same saved data. Referrals also have direct methods replacing the old currentUser layer.
This does not apply to every installed library. Keep Libs.Guard, Libs.Webhooks, Libs.Lang, and the other names shown in their guides. A custom library uses Libs.YourLibrary; removing Libs. does not create a corresponding global object. Installing a library in one bot does not install it in another.
Install and use a library
Open your bot in the mobile app and open Libraries.
Tap Go to install, choose a library, open its details, and use Install to followed by your bot's name.
Check the exact library name and dependencies in its guide. Capitalization matters:
OxaPayLibV1is different fromOxaPayLib.Create the smallest example command from the guide and run it in your test bot.
Configure any required Admin Panel or external account before adding the feature to other commands.

Install from the app-wide Libs catalogue
You can also open Libs from the main app menu, choose a library, and tap Install. In Please select the bot, choose the intended bot and confirm the installation. Return to that bot's Libraries tab and check that it appears there.

When you open the catalogue from a bot's Libraries tab, the app already has that bot as the installation context. From the main Libs catalogue, you must choose the destination. Check this distinction when the library seems to be installed in the wrong place.
If the library provides settings, open that bot's Admin panel, fill the fields required by its guide, and save that panel. Installing code and configuring it are separate steps. The fields depend on the library; the general Admin panel guide explains how to save and verify values.
The official library source repository is useful when checking a library's behavior or building your own. An installed Store library can differ from that repository snapshot; export your bot if you need to inspect the actual installed code.
When a library is missing or behaves differently
Libs.SomeLibrary being undefined usually means the library is not installed for the selected bot or its name differs. Check both before reinstalling. If a dependency is missing, install that dependency too.
Removing a library removes its installed association; it does not establish that all the data it created has been removed. Search your commands and other library code for references before uninstalling it.
Need your own reusable functions? Create a library. Need a complete starter bot? Use a Store example.
Last updated
Was this helpful?