secret-stack
secret-stack copied to clipboard
Key should never be @undefined
const crypto = require("crypto");
const secretStack = require("secret-stack");
const appKey = crypto.randomBytes(32).toString("base64");
const stack = secretStack({ appKey });
const app = stack();
console.log(app.id); // => "@undefined"
Note to self:
We should require (TS) config.keys and/or emit a (JS) warning when it's missing.
I took a swing at this based on your note @staltz , https://github.com/ssb-js/secret-stack/pull/67. A new error is logged when no keys are passed in along with the config and updated the Config type in types.d.ts. Not sure how I feel about the log since it's going to make a lot of tests throughout the ecosystem very noisy. Thoughts?
@austinfrey Thanks for the PR! :) What mix said over there is what I would say too