Skip to content

Instantly share code, notes, and snippets.

@fl0wo
Last active December 12, 2022 20:54
Show Gist options
  • Select an option

  • Save fl0wo/f76c8ca584feff06ed3915f260de8495 to your computer and use it in GitHub Desktop.

Select an option

Save fl0wo/f76c8ca584feff06ed3915f260de8495 to your computer and use it in GitHub Desktop.
Load Stytch client for nodejs
import {Client} from "stytch/types/lib/client";
const stytch = require("stytch");
const creds = require('../../_secrets/stytch_credentials_TEST.json');
let client:Client;
export const loadStytch = ():Client => {
if(!client) {
client = new stytch.Client({
project_id: creds.id,
secret: creds.secret,
env: stytch.envs,
});
}
return client;
}
/* stytch_credentials_TEST.json
{
"id": "<YOUR STYTCH PROJECT ID>",
"secret": "<YOUR STYTCH SECRET KEY>"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment