Extensions
Extensions
Extensions
extensions.md

Extensions

An extension is a package of ordinary Mote: models, server fns, hooks and components that a program takes with one use line. It is written with nothing but the language a program has. It is shipped beside the compiler, in this folder, and is not inside the binary: a program that does not take one carries none of it, and a program that does can read it, copy it, and change it.

usage/What people do in a program, kept in its own database, with an admin panel: active people, the most used screens, actions and calls, what fails, funnels, who came back, and track. docs/usage.md.
usage-forward/The same events, posted as JSON to another tool.
google/Continue with Google: an OpenID Connect sign-in into the program's own accounts and sessions, with a button. docs/google.md.
oauth/Sign-in with GitHub, Microsoft, Apple, Discord, GitLab, LinkedIn, Slack, any OpenID issuer, a connection per customer; tokens kept for providers' APIs; client credentials, device code. docs/oauth.md.
jwt/A public API's door: API keys, tokens, /.well-known/jwks.json, rotation. docs/jwt.md.
totp/A code from an authenticator app as a second factor, recovery codes, and a QR code writer. docs/second-factor.md.
passkey/Passkeys, checked on the back end: a way in, and a second factor. docs/second-factor.md.
magic/Signing in by a link or a code in a mail. docs/magic.md.
stripe/Payments, billing and Connect with Stripe: Checkout in every mode, the program's plans kept at Stripe from its code, subscriptions changed and previewed, usage on meters, invoices, tax, saved cards, disputes, payouts, sellers' accounts and transfers; every event checked, done once and read fresh, into StripePlan, stripeCan and the program's hooks; a billing panel. docs/stripe.md.
paypal/Payments and subscriptions with PayPal: orders approved at PayPal and captured once, refunds, subscriptions, payouts, and its webhooks checked by PayPal's verify call and done once. docs/paypal.md.
paddle/Paddle Billing, a merchant of record: transactions and their checkout links, customers, subscriptions (change with proration, pause, resume, cancel), refunds as adjustments, signed webhooks done once. docs/paddle.md.
polar/Polar, a merchant of record for software: checkouts and checkout links, customers by the program's account, subscriptions, benefits as what an account may do (polarCan), orders, refunds, the portal; Standard Webhooks done once. docs/polar.md.
mail/Mail through Resend or Cloudflare Email Service, one mailSend; a suppression list kept by Resend's events; bodies from Markdown. docs/mail.md.
replicate/Models on Replicate: a prediction waited for or streamed, a long run followed by a job and the webhook across restarts, files in and out. docs/replicate.md.
s3/Files in any S3-compatible bucket, on the aws extension's SigV4: put, get, list, parts, presigned addresses. docs/s3.md.
aws/AWS: SigV4 for any service, a role's keys, SQS, DynamoDB, Lambda, SNS, SES, Bedrock, Secrets Manager, SSM, EventBridge. docs/aws.md.
gcloud/Google Cloud and Google's APIs: Cloud Storage, Sheets, Drive, Calendar, Gmail, FCM and APNs, Pub/Sub, BigQuery, Gemini, Maps. docs/gcloud.md.
azure/Azure Blob Storage and Communication Services Email. docs/azure.md.
ai/Language models (Anthropic, OpenAI's Responses and Chat Completions, Gemini): turns, streaming, tools and answers from the program's own types, batches, files, pictures, speech, costs and budgets, retrieval (chunks, a vector store, Pinecone, Qdrant, reranking), AiChat. docs/ai.md.
twilio/Text messages and phone codes through Twilio. docs/twilio.md.
slack/A Slack app: the Web API (messages, threads, files, people, channels, modals, the home tab), Block Kit as shapes, and events, slash commands and interactivity checked and done in jobs. docs/slack.md.
notion/Notion: databases' data sources queried and read page by page, every property plain, pages made and changed, search, a page's content as Markdown both ways. docs/notion.md.
linear/Linear: issues listed by filter and cursor, made and changed, comments, teams and states over its GraphQL API; its webhooks checked and done once. docs/linear.md.
github/GitHub: repositories, files, issues, pull requests, comments, checks and statuses, releases, Actions over REST page by page and GraphQL; a GitHub App's tokens; webhooks checked and done once. docs/github.md.
graphql/Any GraphQL API: a query and its variables, errors as failures with a kind, a connection page by page. docs/graphql.md.
telegram/A Telegram bot: messages, keyboards, files, presses; updates by webhook or long polling, once. docs/telegram.md.
airtable/Airtable: records listed by formula, view and sort page by page, written ten a request, the base's limit kept, and its changes told by webhooks, once. docs/airtable.md.
discord/A Discord bot: messages with embeds and components, channels, members and roles, webhooks, slash commands, the Interactions Endpoint checked with Ed25519; buckets honoured. docs/discord.md.
mcp/The Model Context Protocol over Streamable HTTP: the program as an MCP server (typed fns as tools, resources, prompts) and as a client of other servers, whose tools the ai extension's loop can call. docs/mcp.md.
alert/A line to Slack, Discord or a webhook; faults once in ten minutes. docs/alert.md.
sentry/Faults and reports to Sentry. docs/sentry.md.
captcha/Turnstile or hCaptcha, the server's check. docs/captcha.md.
postgres/Postgres over its own wire protocol, on tcp.open: parameters, types, a pool, transactions, LISTEN/NOTIFY, COPY. docs/postgres.md.
redis/Redis over RESP (or Upstash's REST API): the common commands typed, pipelines, transactions, pub/sub, streams, a rate limiter, a lock, cache-aside. docs/redis.md.
admin/The admin page: people and their sessions, every model's rows (changed only as the model's own rules let that admin), jobs, health, access, a log of what admins did, and "see what they see". docs/admin.md.

Taking one#

Say where it is in the mote.toml beside the program's entry (or above it), and use its file:

toml
[packages]
usage = "../mote/extensions/usage"
text
use "pkg:usage/usage.mote"

The path is a folder on this machine: from the mote.toml, or whole. A path that climbs out of the project (../../mote/extensions/usage) is fine. Nothing is fetched. A program that is deployed from its own repository copies the folder into it (cp -r …/extensions/usage vendor/usage, and usage = "vendor/usage"): it is a few files of source, and then it is the program's own to keep or change.

A name is declared once in a whole program, so an extension's names all begin with its own (Usage…, usage…).

Writing one#

Edit this page:extensions/README.md
esc
1072 sections of 111 pages, ranked as you type.A heading's words count for more than what stands under it.
↑↓move
↵open
ranked by BM25, in the page