About Plugins
Reusable Elysia plugins for common functionality
Browse the snippets below to find the plugins implementation you need for your Elysia project.
All Plugins Snippets
CORS Plugin
CORS configuration with environment-aware origins
- Origin whitelist
- Credentials support
- Methods config
JWT Plugin
JWT authentication with role-based access control
- JWT sign/verify
- Role-based access
- Token validation
Swagger Plugin
Swagger/OpenAPI documentation for Elysia
- Auto-docs
- Schema inference
- OpenAPI spec
Bearer Token Plugin
Bearer token extraction from multiple sources
- Multi-source extraction
- Custom extractors
- Require guard
Static Files Plugin
Static file serving with caching and SPA support
- File serving
- Cache headers
- SPA fallback
HTML Plugin
HTML response helpers for server-side rendering
- HTML responses
- Template helpers
- Element builders
Streaming Plugin
Server-sent events and streaming responses
- Server-sent events
- Stream helpers
- Keep-alive
How to Use
Install any snippet using the Hanma CLI:
npx hanma add --framework elysia
For example, to install the first snippet:
npx hanma add elysia-cors --framework elysia