APIv3-typescript-library icon indicating copy to clipboard operation
APIv3-typescript-library copied to clipboard

Property 'authentications' is protected and only accessible within class 'TransactionalEmailsApi' and its subclasses

Open flaviobvds opened this issue 2 years ago • 2 comments
trafficstars

I'm trying to run the following code on typescript (found on the official documentation):

import * as SibApiV3Sdk from '@sendinblue/client'
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();

const apiKey = apiInstance.authentications['apiKey'];
apiKey.apiKey = process.env.SENDINBLUE_API_KEY!;

But I'm getting the error: Property 'authentications' is protected and only accessible within class 'TransactionalEmailsApi' and its subclasses.

What am I doing wrong? Is this a bug?

flaviobvds avatar Apr 22 '23 05:04 flaviobvds

Hi @flaviobvds Can you please try with this

import * as SibApiV3Sdk from "@sendinblue/client";

let apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();

apiInstance.setApiKey(
  SibApiV3Sdk.TransactionalEmailsApiApiKeys.apiKey,
  process.env.SENDINBLUE_API_KEY!
);

aayush-sib avatar Apr 22 '23 08:04 aayush-sib

It worked, thanks. But I still think there's a bug related to the authentications property.

flaviobvds avatar Apr 22 '23 21:04 flaviobvds