pilcrowOnPaper / oslo

A collection of auth-related utilities

Home Page:https://oslo.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


A collection of auth-related utilities, including:

  • oslo/cookie: Cookie parsing and serialization
  • oslo/crypto: Generate hashes, signatures, and random values
  • oslo/encoding: Encode base64, base64url, base32, hex
  • oslo/jwt: Create and verify JWTs
  • oslo/oauth2: OAuth2 helpers
  • oslo/otp: HOTP, TOTP
  • oslo/password: Password hashing
  • oslo/request: CSRF protection
  • oslo/webauthn: Verify Web Authentication API attestations and assertions

Aside from oslo/password, every module works in any environment, including Node.js, Cloudflare Workers, Deno, and Bun.

Documentation: https://oslo.js.org


npm i oslo
pnpm add oslo
yarn add oslo


For Node.js 16 & 18, you need to polyfill the Web Crypto API. This is not required in Node.js 20.

import { webcrypto } from "node:crypto";

globalThis.crypto = webcrypto;

Alternatively, add the --experimental-global-webcrypto flag when running Node.

node --experimental-global-webcrypto index.js


A collection of auth-related utilities


License:MIT License


Language:TypeScript 99.1%Language:JavaScript 0.9%