Hey, is there a reason you don't expose interface ...
# ask-a-descoper
w
Hey, is there a reason you don't expose interface and type? For example, AuthenticationInfo. I wanted to pass it to a function but I don't have a type for it.
q
You refer to the auth info that return in the SDK responses? I believe it should be of type
JWTResponse
which is exported
w
I don't see it in the Typescript
What is the client's response type?
This is what I have now
Copy code
import DescopeClient from '@descope/node-sdk';

type DescopeClientType = ReturnType<typeof DescopeClient>;
type AuthenticationInfo = Parameters<DescopeClientType['validatePermissions']>[0];
g
Hey 👋 nice to e-meet you! I’m from Descope engineering team the sdk does’nt expose all types because they can be infer in the same manner you infer them few things that currently can be done: 1. import the
JWTResponse
type from the
@descope/core-js-sdk
2. infer the type of variables similar you described above, we may export
JWTResponse
,
AuthenticationInfo
also from node sdk as well can you elaborate what is the use case that you find it helpful?
w
I want to use
descope
in nestjs, and they recommend do use authorization in Module and Service so we can check specific objects and not only the path.
They recommend to put the result from the authorization in the field
user
in the request for that.
g
Thanks for the feedback fyi I added the types in node-sdk (see PR) and they should be avaialble in the
next
version once the PR is merged (an official release will be avaialble later on 🙂 )
1
w
Thank you.
🙏 1