Javascript SDK V2 unable to create directory

Hello team,
We are facing an issue wherein we are unable to create a directory using SDK in both local and pantaris sandbox. Could you please advise.

Code:

async function createDirectory(calponia: any, dirName: string): Promise {
const projectId = process.env.PANTARIS_PROJECT_ID;
return calponia.api().v2.post(“/directories”, {
project: {
id: projectId,
},
name: dirName,
parentDirectory: {
id: projectId,
},
});
}

Error:
cause: Error: getaddrinfo ENOTFOUND api.local.calponia.dev

1 Like

Hello,

could you please provide the version of the sdk you are using?

I assume its 2.3 based in the URL path(https://cdn.pantaris.io/js/2.3/sdk.zip) shared here : Documentation | PANTARIS

Unfortunately the sdk is kinda unmaintained at the moment. You might try to upgrade to 2.6.
Otherweise please use the API - Pantaris API v2.
With a client of your choice. e.g. axios or node-fetch

Sorry for any inconveniences.