https://supertokens.com/ logo
i

ITEnthusiasm

05/27/2022, 5:23 PM
Does
SuperTokens
expose their error types in TypeScript? It'd be super helpful not to have to reproduce each of the potential types
r

rp

05/27/2022, 5:27 PM
Hey!
Which error types are you talking about? The ones from the session recipe?
i

ITEnthusiasm

05/27/2022, 5:33 PM
Yeah. Like
Copy code
typescript
{
  formFields: [/* ... */],
  status: "",
}
r

rp

05/27/2022, 5:34 PM
Iโ€™m not sure what you are trying to ask for ๐Ÿ˜…
i

ITEnthusiasm

05/27/2022, 5:34 PM
Sorry ๐Ÿ˜…
So like, if something goes wrong while trying to do a login, SuperTokens returns an error object with a shape similar to the one I just sent
I was wondering if SuperTokens exports a TS type that represents the shape of that object.
r

rp

05/27/2022, 5:36 PM
There arenโ€™t any types of that. However, there are functions (in the api interface type) which returns those types.
i

ITEnthusiasm

05/27/2022, 5:41 PM
Ah, okay. Gotcha. Thanks!
3 Views