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

Example in README not working? #42

Open
wug-ge opened this issue Nov 19, 2024 · 2 comments
Open

Example in README not working? #42

wug-ge opened this issue Nov 19, 2024 · 2 comments

Comments

@wug-ge
Copy link

wug-ge commented Nov 19, 2024

Hi,
I tried setting my API Key with version 2.2.0 (as stated in the example):

const brevo = require('@getbrevo/brevo');
let apiInstance = new brevo.TransactionalEmailsApi();

let apiKey = apiInstance.authentications['apiKey'];

However "authentications" seems to be protected and not usable as stated in the example:

error TS2445: Property 'authentications' is protected and only accessible within class 'TransactionalEmailsApi' and its subclasses.

I tried downgrading to 2.1.1 which is the same version as in the example, but it still fails.

How to set the API Key with this package?
Is it project even still maintained?
I raised an issue over a month ago and no one looked into it yet...

@valent1618
Copy link

Hi, you can try :

const brevo = require('@getbrevo/brevo');
let apiInstance = new brevo.TransactionalEmailsApi();

apiInstance.setApiKey(
	TransactionalEmailsApiApiKeys.apiKey,
	"YOUR_KEY"
);

@invalidred
Copy link

I plus one this, had a hard time figuring this out and should be in the docs.

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

3 participants