Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

uncsrf

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uncsrf

Single API for CSRF functions, working in Node.js, Browsers and other runtimes

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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.

Keywords

FAQs

Package last updated on 09 Sep 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc