en-decrypt

Quickstart

Encrypt PII in Node.js

Use fetch against the encryption API. Decrypts do not count.

const res = await fetch("https://en-decrypt.com/v1/encrypt", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.EN_DECRYPT_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ 1: JSON.stringify(payload) }),
});
const value = (await res.json())["1"];