npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@getbrevo/brevo

v3.0.1

Published

NodeJS client for @getbrevo/brevo

Readme

Brevo Node SDK

⚠️ Important Notice: This is the current stable version but we are currently working on rebuilding our Node library from scratch.

Overview

Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full documentation to see all the supported operations.

Brevo's API matches the OpenAPI v2 definition. The specification can be downloaded here.

Our current library is not fully compatible with all modern Node.js and TypeScript environments. To help you integrate Brevo into your applications, we're providing both plain Node.js and TypeScript-specific implementation approaches below while we work on the next generation of our SDK.

Table of Contents

Node.js Implementation

Send Transactional Email

Installation

npm i @getbrevo/brevo --save

Import packages

import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo";

Instantiate API with your credentials

let emailAPI = new TransactionalEmailsApi();
emailAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx"

Build your message

let message = new SendSmtpEmail();
message.subject = "First email";
message.textContent = "Hello world!";
message.sender = { name: "John Doe", email: "[email protected]" };
message.to = [{ email: "[email protected]", name: "Jane Smith" }];

Send the message

emailAPI.sendTransacEmail(message)

(Optional) Log the response

emailAPI.sendTransacEmail(message).then(res => {
    console.log(JSON.stringify(res.body));
}).catch(err => {
    console.error("Error sending email:", err.body);
});

Create Contact

Installation

npm i @getbrevo/brevo --save

Import packages

import { CreateContact, ContactsApi } from "@getbrevo/brevo";

Instantiate API with your credentials

let contactAPI = new ContactsApi();
contactAPI.authentications.apiKey.apiKey = "xkeysib-xxxxxx"

Build your contact

let contact = new CreateContact();
contact.email = "[email protected]";
contact.attributes = {
  FIRSTNAME: "Alice",
  LASTNAME: "Johnson",
};

Create the contact

contactAPI.createContact(contact).then(res => {
  console.log(JSON.stringify(res.body));
}).catch(err => {
  console.error("Error creating contact:", err.body);
});

TypeScript Implementation

Recommended tsconfig.json Settings

We recommend using the following TypeScript configuration for optimal compatibility:

{
  "compilerOptions": {
    "target": "es2020",
    "module": "commonjs",
    "outDir": "dist",
    "rootDir": "src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  },
  "include": ["src"]
}

Send Transactional Email

Installation

npm i @getbrevo/brevo --save

Import packages

import { TransactionalEmailsApi, SendSmtpEmail } from "@getbrevo/brevo";

Instantiate API with your credentials

let emailAPI = new TransactionalEmailsApi();
(emailAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxxxxxxxxxxxxxx";

Build your message

let message = new SendSmtpEmail();
message.subject = "First email";
message.textContent = "Hello world!";
message.sender = { name: "Bob Wilson", email: "[email protected]" };
message.to = [{ email: "[email protected]", name: "Sarah Davis" }];

Send the message

emailAPI.sendTransacEmail(message)

(Optional) Log the response

emailAPI
  .sendTransacEmail(message)
  .then((res) => {
    console.log(JSON.stringify(res.body));
  })
  .catch((err) => {
    console.error("Error sending email:", err.body);
  });

Create Contact

Installation

npm i @getbrevo/brevo --save

Import packages

import { CreateContact, ContactsApi } from "@getbrevo/brevo";

Instantiate API with your credentials

let contactAPI = new ContactsApi();
(contactAPI as any).authentications.apiKey.apiKey = "xkeysib-xxxxxxxxx"

Build your contact

let contact = new CreateContact();
contact.email = "[email protected]";
contact.attributes = {
  FIRSTNAME: { value: "Michael" },
  LASTNAME: { value: "Brown" },
};

Create the contact

contactAPI.createContact(contact).then(res => {
  console.log(JSON.stringify(res.body));
}).catch(err => {
  console.error("Error creating contact:", err.body);
});

Support

For questions and support, please refer to our documentation or contact our support team.

License

This SDK is distributed under the MIT License.