Elysia Helmet is a security plugin for the Elysia web framework, designed to protect applications by setting various HTTP response headers. It functions as a direct port of the well-known `helmet` middleware from the Express ecosystem, adapting its battle-tested security configurations to the modern Elysia runtime. The current stable version is 3.1.0. Given its nature as a framework-specific plugin, its release cadence is closely aligned with updates to the Elysia framework itself and the upstream `helmet` project, ensuring continuous compatibility and incorporating the latest web security best practices. Its primary differentiator is providing a familiar and comprehensive suite of HTTP security headers specifically integrated for Elysia, enabling developers to easily apply crucial security measures without manual header management.
npm install elysia-helmetVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and integrate elysia-helmet into an Elysia application with basic security header configurations, including Content Security Policy, X-Content-Type-Options, and X-Frame-Options.
Ensure your project's Elysia dependency is updated to version 1.2.0 or higher: `bun add elysia@latest`.
Consult the elysia-helmet GitHub repository and examples for the most accurate usage and configuration details within the Elysia framework.
Thoroughly test your application with configured security headers in various browsers. Start with a more permissive CSP and gradually tighten directives while monitoring browser console errors.
Install the package: `bun add elysia-helmet` (or `npm install elysia-helmet`, `yarn add elysia-helmet`). Verify the import statement: `import { helmet } from 'elysia-helmet';`Ensure you are importing `Elysia` from 'elysia' correctly and that your Elysia version meets the 'elysia-helmet' peer dependency (`>= 1.2.0`). Update Elysia if necessary: `bun add elysia@latest`.
Check the `elysia-helmet` source code or the upstream `helmet` documentation for the correct structure of configuration options. Ensure you are using the correct version of `elysia-helmet` that supports the desired options.