Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

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

Open
Antweneee opened this issue Jul 4, 2024 · 0 comments
Open

Comments

@Antweneee
Copy link

Antweneee commented Jul 4, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant