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

Is this documentation a joke ? #25

Open
clementderyckx opened this issue May 3, 2024 · 20 comments
Open

Is this documentation a joke ? #25

clementderyckx opened this issue May 3, 2024 · 20 comments

Comments

@clementderyckx
Copy link

clementderyckx commented May 3, 2024

There is only a single feature, that does not even work. Authentication is a protected key.
I'm sorry, but the team is obviousely not taking seriously the project or even involved in it.
We just have to compare this sh*t to the golang sdk documentation to say so.

Even worst, commits are like "update sdk". Seriously ?

CleanShot 2024-05-03 at 17 45 34@2x

@JotaOdiceu
Copy link

Jokes are for laughs, this documentation is a shame, it makes you want to change everything on the spot

@JotaOdiceu
Copy link

In each new project you need to open at least ten tabs and spend 4 hours just to make something "simple" work

@alexbrazier
Copy link

Jokes are for laughs, this documentation is a shame, it makes you want to change everything on the spot

I tried that, but it's not going well so far 😅 #19

@othmanesghir
Copy link

This should work - example with ContactsApi:

let apiInstance = new SibApiV3Sdk.ContactsApi();
apiInstance.setApiKey(SibApiV3Sdk.ContactsApiApiKeys.apiKey, BREVO_API_KEY);

@bolds07
Copy link

bolds07 commented May 10, 2024

Glad someone said that cuz in 5 minutes of signing up i had just thought the same...
how is possible that the basic tutotirial they have dont work?

not to meniton what the hell was in the mind of the person who created this shit?
omg i've never seen such a messes up project since i left introduction to programming

zero design patterns completelly crazy mess

@mckennapaul27
Copy link

This works for me:

import * as Brevo from "@getbrevo/brevo";
let apiInstance = new Brevo.ContactsApi();
    apiInstance.setApiKey(
      Brevo.ContactsApiApiKeys.apiKey,
      process.env.BREVO_API_KEY || ""
    );
    let createContact = new Brevo.CreateContact();
    createContact.email = email;
    createContact.listIds = [41];
    createContact.attributes = {
      FIRSTNAME: name,
      COUNTRY: country,
    };
    await apiInstance.createContact(createContact);

Documentation is absolutely awful it's ridiculous. Incorrect and out of date information everywhere.

@vicky-gonsalves
Copy link

Such a waste of time! Documentation sucks! Going back to Sendgrid.
"Better Than Brevo"!

@BritoRuan
Copy link

Totally disappointed with this documentation!

@shubhamUpadhyayInBlue
Copy link
Collaborator

Hello!
Apologies to have a bad experience with our SDK. We have not been able to keep the documentation up to date but will try to keep it on a higher priority from now on. I have updated the documentation on Readme.md: https://github.com/getbrevo/brevo-node?tab=readme-ov-file#we-have-two-options

Please take a look and hope it helps.

@JBEnterprises
Copy link

Yeah, this was a waste if time today

@silver-xu
Copy link

Hello! Apologies to have a bad experience with our SDK. We have not been able to keep the documentation up to date but will try to keep it on a higher priority from now on. I have updated the documentation on Readme.md: https://github.com/getbrevo/brevo-node?tab=readme-ov-file#we-have-two-options

Please take a look and hope it helps.

I think it was still wrong. How API key could be setup should be as follows:

	const apiKey = apiInstance.setApiKey(
		brevo.TransactionalEmailsApiApiKeys.apiKey,
		"YOUR API KEY"
	);

@Sebastp
Copy link

Sebastp commented Aug 8, 2024

Such a joke. This one of the worst docs I've seen. How can you push new SDK with this shit of a documentation!!??

@TasseDeCafe
Copy link

TasseDeCafe commented Aug 20, 2024

Hello! Apologies to have a bad experience with our SDK. We have not been able to keep the documentation up to date but will try to keep it on a higher priority from now on. I have updated the documentation on Readme.md: https://github.com/getbrevo/brevo-node?tab=readme-ov-file#we-have-two-options

Please take a look and hope it helps.

It takes 5 minutes to update those TS errors. Why isn't anyone doing it? Any manager seeing this should realize that this is bad for the business when dozens of developers complain that there are errors in README examples.

For anyone looking for correct ES6 imports without TS errors, you can do this:

import { TransactionalEmailsApi, SendSmtpEmail, TransactionalEmailsApiApiKeys } from '@getbrevo/brevo'

const apiInstance = new TransactionalEmailsApi()

apiInstance.setApiKey(
  TransactionalEmailsApiApiKeys.apiKey,
  '<your-api-key>'
)

const sendSmtpEmail = new SendSmtpEmail()

And from there the rest of the code in the README will work.

@alexbrazier
Copy link

We're still maintaining a version at @groupcards/brevo for anyone interested. See #19 for more details.

Also means you don't have to create new classes for every part of the api.

import BrevoApi from "@groupcards/brevo";

const brevo = new BrevoApi({
  headers: {
    "api-key": "YOUR_API_KEY",
  },
});

const account = await brevo.account.getAccount()

@skoulix
Copy link

skoulix commented Aug 26, 2024

We're still maintaining a version at @groupcards/brevo for anyone interested. See #19 for more details.

Also means you don't have to create new classes for every part of the api.

import BrevoApi from "@groupcards/brevo";

const brevo = new BrevoApi({
  headers: {
    "api-key": "YOUR_API_KEY",
  },
});

const account = await brevo.account.getAccount()

This doesn't seem to work either.
I'm getting a "BrevoApi is not a constructor" error.

@alexbrazier
Copy link

We're still maintaining a version at @groupcards/brevo for anyone interested. See #19 for more details.
Also means you don't have to create new classes for every part of the api.

import BrevoApi from "@groupcards/brevo";

const brevo = new BrevoApi({
  headers: {
    "api-key": "YOUR_API_KEY",
  },
});

const account = await brevo.account.getAccount()

This doesn't seem to work either. I'm getting a "BrevoApi is not a constructor" error.

Ah, looks like there was an issue with the build that meant to had to add .default to the end of the import. Would you be able to try again with version 2.2.0 to see if that fixes the issue?

@skoulix
Copy link

skoulix commented Aug 26, 2024

We're still maintaining a version at @groupcards/brevo for anyone interested. See #19 for more details.
Also means you don't have to create new classes for every part of the api.

import BrevoApi from "@groupcards/brevo";

const brevo = new BrevoApi({
  headers: {
    "api-key": "YOUR_API_KEY",
  },
});

const account = await brevo.account.getAccount()

This doesn't seem to work either. I'm getting a "BrevoApi is not a constructor" error.

Ah, looks like there was an issue with the build that meant to had to add .default to the end of the import. Would you be able to try again with version 2.2.0 to see if that fixes the issue?

Yes it works after updating to the new version.

Thank you.

@nrathi
Copy link

nrathi commented Aug 30, 2024

@alexbrazier I'm still getting "This expression is not constructable."

@ishaangandhi
Copy link

ishaangandhi commented Oct 11, 2024

This is what I have:

import brevo from "@getbrevo/brevo";

let brevoApi = new brevo.TransactionalEmailsApi();
const apiKey = process.env.BREVO_API_KEY;
if (!apiKey) throw new Error("Missing BREVO_API_KEY");
brevoApi.setApiKey(brevo.TransactionalEmailsApiApiKeys.apiKey, apiKey);

And this is the error I get:

TypeError: Cannot read properties of undefined (reading 'TransactionalEmailsApi')

Is anyone else getting this error?

@shubhamUpadhyayInBlue
Copy link
Collaborator

Hi @ishaangandhi
Can you please try to clean the npm cache and reinstall the dependencies?

  • npm cache clean --force
  • npm install

This is not reproducible every time, but it occurred with me just once and I followed this above steps to fix it.

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