Last active
December 12, 2022 20:54
-
-
Save fl0wo/f76c8ca584feff06ed3915f260de8495 to your computer and use it in GitHub Desktop.
Load Stytch client for nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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