elysiajs

Create type-safe backend servers with the ElysiaJS TypeScript framework.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aashahin/ai-skills --skill elysiajs-aashahin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: elysiajs
Source: https://github.com/aashahin/ai-skills/tree/main/elysiajs
Command: npx skills add https://github.com/aashahin/ai-skills --skill elysiajs-aashahin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building backend APIs in TypeScript often means juggling separate validation libraries, losing type safety between server and client, and wiring up plugins manually. This Skill provides complete guidance for developing with ElysiaJS, a Bun-first framework that unifies runtime validation and static types in a single source of truth. ## Core Features & Use Cases - Routing & Validation: Create routes with TypeBox, Zod, or Valibot schemas covering body, params, query, headers, cookies, and responses. - Plugins & Auth: Configure official plugins for JWT, CORS, OpenAPI, WebSocket, cron, and integrate Better Auth, Drizzle ORM, or Eden Treaty for end-to-end type-safe clients. - Deployment & Testing: Compile to a single binary, deploy to Docker, Cloudflare Workers, Vercel, or Node.js, and write unit tests against Elysia instances. - Use Case: Scaffold a REST API with JWT authentication, Drizzle-backed models, OpenAPI documentation, and an Eden Treaty client consumed by a Next.js frontend. ## Quick Start Ask the assistant to create an ElysiaJS server with a validated POST route and JWT authentication, then scaffold it with bun create elysia app.

Frequently Asked Questions about elysiajs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a backend server with ElysiaJS?▼

Scaffold a project with bun create elysia app, then define routes by chaining methods like .get() and .post() on a new Elysia instance. Attach TypeBox schemas in route options to validate body, params, and query with full type inference.

How do I add JWT authentication to an Elysia server?▼

Install @elysiajs/jwt and register it with .use(jwt({ name: 'jwt', secret })). Then call jwt.sign() to issue tokens and jwt.verify() in protected routes, typically storing the token in a signed cookie.

Can ElysiaJS run on Node.js or Cloudflare Workers?▼

Yes. Use the @elysiajs/node adapter for Node.js, or the CloudflareAdapter from elysia/adapter/cloudflare-worker with .compile() for Workers. Deno, Vercel, Expo, and Next.js API routes are also supported via Web Standard Request/Response.

What is the difference between TypeBox and Zod validation in Elysia?▼

TypeBox is Elysia's native schema library accessed via the t export, offering the tightest type inference and features like t.File and t.Cookie. Zod, Valibot, and ArkType are supported through Standard Schema for teams preferring those ecosystems.

Why does my Elysia plugin lose types when I use it in another instance?▼

Elysia encapsulates lifecycle hooks and decorations by default, so they do not leak between instances. Declare dependencies explicitly with .use(plugin), and set hook scope to 'scoped' or 'global' when you need shared behavior.

How do I deploy an Elysia server to production?▼

Compile to a single binary with bun build --compile --target bun, then run it directly or inside a distroless Docker image. Enable health check routes, graceful shutdown handlers, and environment-based configuration for production readiness.