stytchauth / stytch-node

Official Stytch Backend SDK for Node.js
https://stytch.com
MIT License
87 stars 20 forks source link

TS String Enum for Stytch Token Type #323

Open grant opened 1 month ago

grant commented 1 month ago

I'd like to have a TS constant and a union type. Something like:

import {StytchToken, StytchTokenType} from "stytch";

const MAGIC_LINKS_TOKEN: StytchTokenType = StytchToken.Magic_Links; // "magic_links";

Docs:

https://stytch.com/docs/guides/dashboard/redirect-urls#structure

I don't want to use the "magic_links" string.

chris-stytch commented 1 month ago

Heya @grant! Thanks for the feedback.

You can see how we handled this in one of our Next.js example apps here: https://github.com/stytchauth/stytch-nextjs-integration/blob/main/pages/authenticate.tsx#L5-L24

Our app using consts there does align with the theme of your feedback here as well. I'll chat with our SDK team about this!

grant commented 1 month ago

Sweet, sounds good @chris-stytch . Will hardcode these for now.