Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
flaviobvds opened this issue Apr 22, 2023 · 2 comments

Comments

@flaviobvds
Copy link

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?

@aayush-sib
Copy link
Contributor

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!
);

@flaviobvds
Copy link
Author

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

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

No branches or pull requests

2 participants