uncsrf
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

uncsrf

npm version npm downloads Github Actions CI License

This library provides a single api to create and verify csrf token. It use web-crypto for non Node.js target and node:crypto using Conditional Exports.

Requirements:

  • Node.js
  • Browser: Secure Context (HTTPS/Localhost) in Supported Browsers
  • Other Runtimes: Exposed globalThis.crypto and globalThis.crypto.subtle. (you can polyfill if needed)

Usage

Install package:

# npm
npm install uncsrf

# yarn
yarn add uncsrf

# pnpm
pnpm install uncsrf

Import:

// ESM
import { importEncryptSecret, create, verify } from 'uncsrf'

// CommonJS
const { importEncryptSecret, create, verify } = require('uncsrf')

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛, inspired by uncrypto.

Published under MIT License.

/uncsrf/

    Package Sidebar

    Install

    npm i uncsrf

    Weekly Downloads

    24,400

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    13.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • morgbn