
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
@elysiajs/jwt
Advanced tools
Plugin for Elysia for using JWT Authentication.
bun add @elysiajs/jwt
import { Elysia, t } from 'elysia';
import { jwt } from '@elysiajs/jwt';
const app = new Elysia()
.use(
jwt({
name: 'jwt',
// This should be Environment Variable
secret: 'MY_SECRETS',
})
)
.get('/sign/:name', async ({ jwt, cookie: { auth }, params }) => {
auth.set({
value: await jwt.sign(params),
httpOnly: true,
});
return `Sign in as ${params.name}`;
})
.get('/profile', async ({ jwt, set, cookie: { auth } }) => {
const profile = await jwt.verify(auth);
if (!profile) {
set.status = 401;
return 'Unauthorized';
}
return `Hello ${profile.name}`;
})
.listen(8080);
This package extends jose, most config is inherited from Jose.
Below are configurable properties for using JWT plugin
Name to decorate method as:
For example, jwt will decorate Context with Context.jwt
JWT secret key
Type strict validation for JWT payload
Below is the config inherits from jose
@default 'HS256'
Algorithm to sign JWT with
Critical Header Parameter.
JWT Issuer
JWT Subject
JWT Audience
JWT ID
JWT Not Before
JWT Expiration Time
JWT Issued At
FAQs
Plugin for Elysia for using JWT Authentication
The npm package @elysiajs/jwt receives a total of 27,184 weekly downloads. As such, @elysiajs/jwt popularity was classified as popular.
We found that @elysiajs/jwt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.