sendinblue / APIv3-typescript-library

SendinBlue's API v3 client
40 stars 19 forks source link

Est-ce possible d'avoir un vrai SDK? #39

Closed ScreamZ closed 1 year ago

ScreamZ commented 2 years ago

Bonjour,

cela fait des années que sendinblue existe maintenant et je constate qu'il vous est toujours aussi difficile de maintenir un SDK facile d'utilisation, malgré l'ajout d'une version typescript cela reste horriblement compliqué et non intuitif.

Je ne suis pas là pour blamer gratuitement l'équipe, mais voulez-vous de l'aide sur le sujet ? Je commence à songer sérieusement à migrer tous les clients chez Sendgrid ou un autre outil qui fourni un toolkit cohérent et adapter. Le « Made In France » commence à ne plus être un argument suffisant pour remplir les besoins.

À minima, merci de simplifier l'utilisation des API Keys ou donner des exemples exhaustifs, actuellement c'est très verbeux et plus compliqué que faire les appels en REST…

Merci d'avance

ScreamZ commented 2 years ago

Je vous partage également une petite erreur dans votre documentation semblerait-il

Screenshot 2021-09-23 at 18 07 55
aayush-sib commented 2 years ago

Hi @ScreamZ

Sorry for all the inconvenience due to the wrapper. We are planning to build our own wrappers and remove the dependency of swagger codegen. For the readme part, thanks for reporting it. We will try to fix it as soon as possible.

Thanks!

kbsali commented 2 years ago

I could not agree more! I'm only starting playing around with SIB, but already considering moving to Sendgrid... :/

eakl commented 2 years ago

Sendinblue SDK is a pain in the ass and I almost moved to Sendgrid too. Poor SDK and poor documentation.

I managed to make it work with this code

import SibApi from '@sendinblue/client'

export const getData = (formValues: FormValuesProps) => {
  const data: SibApi.SendSmtpEmail = {
    to: [{
      email: formValues.email,
    }],
    sender: {
      email: 'your@domain.com',
      name: 'Your Company',
    },
    templateId: 123,
    subject: `Welcome to {{ params.name }}!`,
    params: {
      name: 'Your Company',
      // ...other variables
    },
  }

  return data
}
// import SibApi from '@sendinblue/client' <-- THIS DOESN'T WORK!
import * as SibApi from '@sendinblue/client'
import { config } from '@config'

const Sendinblue = new SibApi.TransactionalEmailsApi()
Sendinblue.setApiKey(
  SibApi.TransactionalEmailsApiApiKeys.apiKey,
  config.SENDINBLUE.API_KEY,
)

export const sendMail = async (data: SibApi.SendSmtpEmail) => {
  return Sendinblue.sendTransacEmail(data)
}
const emailData = getData({ email })

try {
  await sendMail(emailData)
}
chrisbag commented 1 year ago
Sendinblue.setApiKey(
  SibApi.TransactionalEmailsApiApiKeys.apiKey,
  config.SENDINBLUE.API_KEY,
)

thanks for the snippets which work like a charm, can't believe that SendInBlue does not have working typescript snippets in its doc.

aayush-sib commented 1 year ago

Hi We have fixed the examples in the readme