Quickstart
From zero to first encrypted payload in under two minutes.
~ 1 min read
You’ll need a sandbox API key. Grab one at example.com/signup.
1. Install
npm
bashnpm install @example/cipherbun
bashbun add @example/cipherpnpm
bashpnpm add @example/cipher2. Encrypt
import { Cipher } from "@example/cipher";
const cipher = new Cipher({ apiKey: process.env.CIPHER_KEY });
const sealed = await cipher.encrypt({ payload: "secret note" });sealed is a string-encoded envelope. Stash it anywhere — Postgres, S3, a cookie.
3. Decrypt
const { payload } = await cipher.decrypt(sealed);
console.log(payload); // "secret note"That’s it.
Last updated
Edit this page