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

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

@Antweneee

Description

@Antweneee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions