1.0.7 • Published 11 months ago

cookie-signature-edge v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

cookie-signature-edge

A package that sign and unsign cookies for Edge API Routes.

Installation

With NPM

npm i cookie-signature-edge --save

With Yarn

yarn add cookie-signature-edge --save

Example

Use this module in Edge API Routes

import {sign,unsign} from 'cookie-signature-edge'

export const config = {
  runtime: 'edge',
}

export default async (req) => {
  const value = "hello2";
  const secret='qwertyuiasdfghjkzxcvbnm';
  const signedValue=await sign(value,secret);
  const unsignedValue = await unsign(signedValue,secret)
  console.log(unsignedValue);
  // value===unsignedValue
  // unfinished code ...
}

Contribution

Suggestions with code examples or pull requests are encouraged.

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago