You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

elysia-auth-drizzle

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elysia-auth-drizzle

Library who handle authentification (Header/Cookie/QueryParam).

1.3.8
npmnpm
Version published
Maintainers
1
Created
Source

elysia-auth-drizzle

Library who handle authentification (Header/Cookie/QueryParam).

Usage

import { elysiaAuthDrizzlePlugin } from 'elysia-auth-drizzle';

export const app = new Elysia()
  .use(
      elysiaAuthDrizzlePlugin<typeof users.$inferSelect>({
        config: [
          {
            url: '/public',
            method: 'GET',
          },
        ],
        jwtSecret: 'test',
        drizzle: {
          db: db,
          usersSchema: users,
          tokensSchema: tokens,
        },
      }),
    )

Plugin options

namedefaultdescription
jwtSecretundefinedSecret used to sign JWT
drizzleundefinedContain drizzle db + users schema + tokens schemas ({db, userSchemas, tokenSchemas} / Token Schemas is optional if you use verifyAccessTokenOnlyInJWT)
config[]Array who contain url with method allowed in public
cookieSecretundefined(optional) Secret used to sign cookie value
verifyAccessTokenOnlyInJWTfalse(optional) Check only JWT expiration not token validity in DB
userValidationundefined(optional) (user) => void or Promise<void> / Allow to make more check regarding user (ex: check if user is banned)

Tests

To execute jest tests (all errors, type integrity test)

bun test

FAQs

Package last updated on 26 Jun 2025

Did you know?

Socket

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.

Install

Related posts