Skip to main content

Standard Library

Libraries are bundled collections of reusable subflows — payments, formatting, weather, currency, and more. Instead of hand-writing an API integration, you import a library and call its subflows.

Importing a library

Add an import line before the bot block, then call its subflows with dot notation and await:

import format from "format"

bot MyBot {
flow price on command "/price" {
let { result } = await format.money(amount: 9.5, symbol: "$")
send.text(`That'll be ${result}`)
}
}
  • import format from "format" brings in the library under the alias format.
  • await format.money(...) calls one of its subflows.
  • let { result } = … destructures the named outputs (see Subflows).

Adding from the Store

You don't have to type the import by hand. In the Store, open the Libraries tab, find a library, and click Add to Bot — it inserts the import line for you. In the code editor, typing import " also autocompletes available library names.

Secrets stay in your bot

Libraries never read your global.* variables directly. Anything secret — an API key — is a parameter you pass in. Keep the secret in a global.* variable (set in the Variables panel) and hand it to the call:

let { temp } = await openweather.current_weather(city: "London", api_key: global.openweather_api_key)

The 22 bundled libraries

LibraryWhat it doesPage
apironeApirone crypto payments (wallet/account model)Crypto Payments
nowpaymentsNOWPayments crypto payments (receive-only)Crypto Payments
oxapayOxaPay crypto payment gatewayCrypto Payments
cryptomusCryptomus crypto payment gatewayCrypto Payments
aiLLM chat/classify/summarize/extract/moderateIntegrations
notionNotion pages & databasesIntegrations
airtableAirtable recordsIntegrations
openweatherOpenWeatherMap current weatherIntegrations
mailtmDisposable email inboxesIntegrations
translateLibreTranslate text translationIntegrations
geocodeNominatim geocoding (place ↔ coords)Integrations
pricesCoinGecko crypto pricesUtilities
shortenis.gd URL shortenerUtilities
qrQR-code image URLsUtilities
fx_ratesCurrency exchange ratesUtilities
unitsCrypto unit conversion (satoshi/sun)Utilities
math_xAdvanced numeric helpersUtilities
formatDisplay string formattingUtilities
datetimeDate/time helpersUtilities
textGeneric string utilitiesUtilities
validateInput validation predicatesUtilities
antispamSpam/heuristic content checksUtilities
note

A library is self-contained — it can't import another library. Calls that hit the network can fail, so attach on error { } (see Error handling).