Aviram Berg
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?Asaf Shen
04/02/2023, 11:53 AMAsaf Shen
04/02/2023, 12:26 PMAviram Berg
04/02/2023, 12:34 PMMeir Wahnon
04/02/2023, 1:10 PMNir Gur Arie
04/02/2023, 1:13 PMMeir Wahnon
04/03/2023, 8:31 AMAviram Berg
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:../..",Aviram Berg
04/03/2023, 9:30 AMNir Gur Arie
04/03/2023, 9:31 AMnpm run build on the repo root level and try again?Nir Gur Arie
04/03/2023, 9:37 AMBar Saar
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!