What exo-kit is
@exo/kit is a TypeScript library of small, independent modules for self-hosted services. The package carries the MIT licence; its source repository is private for now. One package version covers every module, and each module is imported from its own subpath.
The rule#
A module is a factory with an explicit config. It never reads
process.env, and it never knows the name of a product.
You call a factory once in a small wiring file, pass it the configuration, and export what it returns. The rest of your code imports that file.
Modules#
| Import | What it gives you |
|---|---|
@exo/kit/env | defineEnv, str, num, bool, url, enumOf, renderEnvExample: one validated, typed environment schema. |
@exo/kit/health | createHealth: live() and ready() probes as Web Responses. |
@exo/kit/log | createLogger: JSON logs to stdout and an audit trail. |
@exo/kit/telemetry | createTelemetry: one place that receives "something went wrong". |
@exo/kit/telemetry/sentry | wireSentry, createScrubber, scrubEvent: Sentry on that seam, with secrets scrubbed. |
@exo/kit/infra | createDb (Postgres), createRedis. |
@exo/kit/signin | createExoSignIn, fromPg, fromPostgres: sign in with an exo account and keep your own sessions. |
@exo/kit/gate | createGateClient: ask the exo gate who a request belongs to. |
@exo/kit/ai | createAiClient: ask the exo AI gateway for a model tier. |
@exo/kit/mailer | createMailer: transactional email over Resend. |
@exo/kit/bot | createBotRoute, fromExoUsers, botpark: the product side of a Telegram bot. |
@exo/kit/connector-sdk | createConnectorHandler: a signed route that lets a support desk read facts about your product. |
@exo/kit/http | validateHost, isReservedAddress: a check against server-side request forgery. |
@exo/kit/client | fetchJson, jsonBody, cn, createI18n, useLanguage and more: the browser half. |
@exo/kit/migrate | syncKitMigrations, checkKitMigrations and the exo-kit-migrations command. |
The package also ships Dockerfile and compose templates. See Migrations and templates.
Dependencies#
Each module pulls in only what it needs, so importing a logger does not require a database driver. The peer dependencies pg, postgres, ioredis, pino, zod and react are all optional: install the ones your imported modules use.
| Module | Needs |
|---|---|
env | zod |
log | pino |
infra | postgres, ioredis |
client | react (only for createI18n and useLanguage) |
health, telemetry, ai, mailer, http, gate | nothing |
The root import @exo/kit exports types only. Import the factories from their subpaths.
Start with Install and wire a module.