Hi all! I am using the node sdk and trying to init...
# ask-a-descoper
v
Hi all! I am using the node sdk and trying to initialize the descopeClient in order to build an authMiddleware for my server. according to the docs it receives as a param of the projectId:
Copy code
const descopeClient = DescopeClient({ projectId: 'P2Pv6qoZJMi7G9p7HGdl4sq4hoEj' });
but the code doesn't compile getting the following error:
Copy code
Argument of type '{ projectId: string; baseUrl: string; logger: Console; }' is not assignable to parameter of type '{ managementKey?: string | undefined; }'.
i am using typescript. I'd appreciate some help with the issue! Thanks in advance!
o
hi @victorious-bear-91897 how do you import
DescopeClient
?
v
hi @orange-belgium-27264
Copy code
import DescopeClient from '@descope/node-sdk';
o
let me check
can you check your package.json for the node-sdk package version?
I’m running this locally and it works well
v
From my package.json:
Copy code
"@descope/node-sdk": "^1.5.0"
o
are you also using core-js ?
can you share your full package.json and/or lockfile? DM is fine if you need to
also what node version are you using?
v
node version
v16.19.0
core-js
is used by storybook in our project
o
can you confirm the core-js version?
v
storybook is using
v3.19.1
o
I mean
@descope/core-js-sdk
can you share your lockfile ?
v
Backend:
Copy code
@descope/node-sdk 1.5.0
└── @descope/core-js-sdk 1.2.1
Frontend:
Copy code
@descope/react-sdk 1.0.3
└─┬ @descope/web-component 2.0.14
  └─┬ @descope/web-js-sdk 1.0.8
    └── @descope/core-js-sdk 1.0.9
we are using pnpm monorepo so it's on the same lockfile
o
hmmm @few-holiday-24516 @great-diamond-35515 wdyt ? this might be a collision situation looks like typescript for some reason uses the old types
you can use use overrides in package.json to ensure you get the latest core-js-sdk until we fix this issue
or use
@descope/react-sdk@next
to get the latest dependencies
v
using `@descope/react-sdk@next`:
Copy code
@descope/react-sdk 0.0.0-next-5d8a7e3a-20230517
└─┬ @descope/web-component 2.3.1
  └─┬ @descope/web-js-sdk 1.2.1
    └── @descope/core-js-sdk 1.3.1
but still having the types issue
f
@victorious-bear-91897 Do you want to have a quick Zoom call?
v
yeah sure
Seems like the problem had something to do with pnpm when we tried with a newer version it worked Thanks everyone