many-receptionist-47314
04/02/2023, 11:52 AMimport DescopeClient from '@descope/node-sdk';
try{
// baseUrl="<URL>" // When initializing the Descope clientyou can also configure the baseUrl ex: <https://auth.company.com> - this is useful when you utilize CNAME within your Descope project.
const descopeClient = DescopeClient({ projectId: '__ProjectID__' });
} catch (error) {
// handle the error
console.log("failed to initialize: " + error)
}
The problem is when I console.log the “DescopeClient” the result is undefined and I can’t initiate the DescopeClient({ projectId: ‘__ProjectID__’ }) object.
I checked the node module and everything seems fine. Does anyone have a suggestion? do I use the sdk properly?great-diamond-35515
04/02/2023, 11:53 AMgreat-diamond-35515
04/02/2023, 12:26 PMmany-receptionist-47314
04/02/2023, 12:34 PMsquare-vr-55083
04/02/2023, 1:10 PMfew-holiday-24516
04/02/2023, 1:13 PMsquare-vr-55083
04/03/2023, 8:31 AMmany-receptionist-47314
04/03/2023, 9:29 AMRUN npm install
RUN npm run build
but now I’m getting a new error:
Cannot find module ‘@descope/node-sdk’
I’ve also looked at the package.json:
"@descope/node-sdk": "file:../..",
many-receptionist-47314
04/03/2023, 9:30 AMfew-holiday-24516
04/03/2023, 9:31 AMnpm run build
on the repo root level and try again?few-holiday-24516
04/03/2023, 9:37 AMstocky-van-20808
04/03/2023, 5:52 PMesModuleInterop: true
in your tsconfig.json|ts
file when using import
syntax to load the sdk as ES module. we will also add this to our knowledge base, thank you!