https://supertokens.com/ logo
Title
j

jin49

10/12/2022, 8:11 PM
I just want to do
const config: SuperTokensConfig = { appInfo: ..., ...}
and have typescript enforce type correctness of the config
r

rp

10/12/2022, 8:14 PM
hey @jin49
the types are not exposed by the frontend SDK unfortunately. That beignn said, you can add your config directly in supertokens.init(config) And then if the implicit type of
config
is wrong, TS will complain
p

porcellus

10/12/2022, 8:16 PM
it's a bit hacky, but you could do something like:
ts
const config: Parameters<typeof SuperTokens.init>[0] = {.... };
(depending on the TS version)
j

jin49

10/12/2022, 8:17 PM
fancy, I didn't know TS supported reflection like that
thanks for the pointers and affirming that I'm not missing something simple!
p

porcellus

10/12/2022, 9:23 PM
happy to help 🙂 TS can do pretty powerful stuff (to the point where it gets really hard understand :D)