PinataCloud / Pinata-SDK

Official SDK for the Pinata IPFS service
MIT License
273 stars 67 forks source link

Unable to create an object pinataSDK or PinataClient in TypeScript #177

Open Antweneee opened 3 months ago

Antweneee commented 3 months ago

Hi, im trying to use the pinata sdk on type script, using: import pinataSDK from '@pinata/sdk'; import PinataClient from '@pinata/sdk';

But im encounterig the following error:

TypeError: sdk_1.default is not a constructor

Im declaring the SDK as follow: const pinata = new pinataSDK(pinataApiKey, pinataSecretApiKey) in my class method but it does not work.

I also tried declaring a variable in my class in the constructor but that didn't worked as well... `private pinata : pinataSDK

constructor() {
    this.pinata = new pinataSDK(pinataApiKey, pinataSecretApiKey)
}`

I tried both with pinataSDK and PinataClient but I have the same error in both cases