brevo-node icon indicating copy to clipboard operation
brevo-node copied to clipboard

Is this documentation a joke ?

Open clementderyckx opened this issue 1 year ago • 23 comments

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

clementderyckx avatar May 03 '24 15:05 clementderyckx

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 😅 https://github.com/getbrevo/brevo-node/pull/19

alexbrazier avatar May 07 '24 09:05 alexbrazier

This should work - example with ContactsApi:

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

othmanesghir avatar May 08 '24 02:05 othmanesghir

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

bolds07 avatar May 10 '24 16:05 bolds07

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.

mckennapaul27 avatar May 17 '24 11:05 mckennapaul27

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

vicky-gonsalves avatar Jun 01 '24 07:06 vicky-gonsalves

Totally disappointed with this documentation!

BritoRuan avatar Jun 05 '24 03:06 BritoRuan

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.

shubhamUpadhyayInBlue avatar Jun 11 '24 14:06 shubhamUpadhyayInBlue

Yeah, this was a waste if time today

JBEnterprises avatar Jun 20 '24 17:06 JBEnterprises

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

silver-xu avatar Jun 22 '24 09:06 silver-xu

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

Sebastp avatar Aug 08 '24 23:08 Sebastp

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.

TasseDeCafe avatar Aug 20 '24 14:08 TasseDeCafe

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()

alexbrazier avatar Aug 20 '24 15:08 alexbrazier

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.

skoulix avatar Aug 26 '24 12:08 skoulix

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?

alexbrazier avatar Aug 26 '24 13:08 alexbrazier

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.

skoulix avatar Aug 26 '24 13:08 skoulix

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

nrathi avatar Aug 30 '24 18:08 nrathi

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?

ishaangandhi avatar Oct 11 '24 14:10 ishaangandhi

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.

shubhamUpadhyayInBlue avatar Oct 14 '24 04:10 shubhamUpadhyayInBlue

Documentation still has not been updated as of Jan 12 2025. Correct code for initiation:

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

apiInstance.setApiKey(
	brevo.TransactionalEmailsApiApiKeys.apiKey,
	'api-key'
);

circularchaos avatar Jan 12 '25 10:01 circularchaos