Fastify Plugins
Fastify Plugins
20 production-ready Fastify 5 plugins covering auth, storage, email, AI, PDF generation, and third-party integrations. All plugins are typed with TypeScript and follow consistent registration patterns.
Packages
| Plugin | Version | Description |
|---|---|---|
| fastify-xadmin | 1.1.0 | Admin APIs — tenants, roles, users, audit, impersonation, Stripe |
| fastify-x-ai | 1.3.0 | Vercel AI SDK — text, streaming, embeddings, structured output |
| fastify-xauth-better | 2.2.0 | Better Auth — multi-instance, orgs, 2FA, audit |
| fastify-xauth-jwks | 1.3.0 | JWKS JWT validation — path-based multi-provider |
| fastify-xauth-local | 1.3.0 | Local JWT auth with RBAC |
| fastify-xconfig | 2.3.0 | Core infrastructure — CORS, rate limiting, Prisma, health, error handling |
| fastify-xemail | 1.2.0 | SendGrid email integration |
| fastify-xgeocode | 1.3.0 | Geocodio address geocoding |
| fastify-xhubspot | 1.3.0 | HubSpot CRM integration |
| fastify-ximagepipeline | 1.3.0 | Image uploads with EXIF strip, moderation, R2 |
| fastify-xlogger | 1.3.0 | Pino structured logging |
| fastify-xpdf | 1.3.0 | PDF generation from HTML/Markdown |
| fastify-xplaid | 1.3.0 | Plaid financial data |
| fastify-xrcs | 1.3.0 | Twilio RCS rich cards |
| fastify-xsignwell | 1.3.0 | SignWell document signing |
| fastify-xstorage | 1.3.0 | S3-compatible storage |
| fastify-xstripe | 1.3.0 | Stripe webhook handlers |
| fastify-xswagger | 1.3.0 | Route-scoped Swagger docs |
| fastify-xtwilio | 1.3.0 | Twilio SMS, Conversations, RCS |
| fastify-xwhatconverts | 1.3.0 | WhatConverts lead tracking |
Common Registration Pattern
All plugins follow the same pattern — all configuration is passed explicitly via options. Plugins never read process.env; the consumer owns env access and passes values in:
import Fastify from 'fastify'
import xPlugin from '@xenterprises/fastify-xplugin'
const fastify = Fastify({ logger: true })
await fastify.register(xPlugin, {
apiKey: process.env.PLUGIN_API_KEY, // consumer reads env, not the plugin
// ...other plugin options
})
Plugins validate their options at registration and fail fast — a missing required option throws an Error naming the plugin, the option, its type, and a usage example, e.g. xplugin: missing required option `apiKey` (string), e.g. `app.register(xPlugin, { apiKey: '...' })` . Anything not required has a safe default, so minimal registrations stay minimal.
Each plugin exposes its API on a single decorator named after the plugin in camelCase (fastify.xLogger, fastify.xStripe, fastify.xPdf, …).
Fastify 5 Compatibility
All plugins are built for Fastify 5 and are:
- ESM-only, with TypeScript declarations (
.d.ts) shipped alongside - Wrapped in
fastify-plugin(fp()) so decorators are visible to the parent scope - Registered asynchronously, with
fastify: ^5.0.0as a peer dependency
Prerequisites
- Node.js 20+
- Fastify 5.x
AI Context
section: "@xenterprises fastify plugins"
plugins: xadmin, x-ai, xauth-better, xauth-jwks, xauth-local, xconfig, xemail, xgeocode, xhubspot, ximagepipeline, xlogger, xpdf, xplaid, xrcs, xsignwell, xstorage, xstripe, xswagger, xtwilio, xwhatconverts
use-when: Overview of all 20 production-ready Fastify 5 plugins — navigate here to discover which plugin covers a given capability
package-naming: "@xenterprises/fastify-<pluginname>"
config: Consumers pass all configuration via register options — plugins never read process.env and fail fast on missing required options
decorators: Each plugin exposes a single camelCase decorator (fastify.xLogger, fastify.xStripe, fastify.xPdf, ...)
requirements: Node.js 20+, Fastify 5.x, ESM-only
