SDKs overview
Sendinblue, rebranded as Brevo, provides a suite of Software Development Kits (SDKs) to facilitate integration with its API. These SDKs are designed to abstract the underlying HTTP requests and JSON responses, allowing developers to interact with Sendinblue services using native language constructs. The official SDKs cover popular programming languages, providing methods for common operations such as sending emails, managing contacts, creating campaigns, and automating marketing workflows. Utilizing an SDK can reduce development time and potential errors compared to making raw HTTP requests, by handling authentication, request formatting, and response parsing automatically.
The Sendinblue API supports various functionalities integral to digital communication strategies. Developers can integrate transactional email sending for order confirmations or password resets, manage contact lists, segment audiences, and initiate marketing automation scenarios directly from their applications. The API also supports SMS messaging and managing conversations through its chat features. Detailed documentation for the entire API surface is available on the official Sendinblue developer documentation portal, including comprehensive API reference guides for each endpoint.
Official SDKs by language
Sendinblue maintains official SDKs for several programming languages, ensuring up-to-date and supported integrations for developers. These SDKs are typically open-source and hosted on platforms like GitHub, allowing community contributions and transparency in their development. Each SDK provides a consistent interface to the Sendinblue API, although the specific method names and object structures will adhere to the conventions of their respective languages.
| Language | Package Name | Typical Installation Command | Maturity |
|---|---|---|---|
| Node.js | sib-api-v3-sdk |
npm install sib-api-v3-sdk |
Stable |
| Ruby | brevo-ruby |
gem install brevo-ruby |
Stable |
| PHP | brevo/brevo-php-sdk |
composer require brevo/brevo-php-sdk |
Stable |
| Python | brevo-python |
pip install brevo-python |
Stable |
| Java | brevo-java-client |
Add to pom.xml via Maven Central |
Stable |
| Go | github.com/brevo/brevo-go |
go get github.com/brevo/brevo-go |
Stable |
The maturity of these SDKs indicates that they are well-tested and maintained, suitable for production environments. Developers are encouraged to consult the specific SDK's documentation for any language-specific nuances or advanced configuration options. For example, the Node.js SDK provides asynchronous methods, aligning with typical Node.js development patterns, while the Java SDK integrates well with Maven or Gradle build systems.
Installation
Installing a Sendinblue SDK typically involves using a language-specific package manager. The process is straightforward, requiring a single command in most cases. Before installation, ensure that you have the appropriate language runtime and package manager installed on your development environment. For example, Node.js projects require npm or yarn, Python projects use pip, and PHP projects often utilize Composer.
Node.js
npm install sib-api-v3-sdk
# or
yarn add sib-api-v3-sdk
Ruby
gem install brevo-ruby
PHP
composer require brevo/brevo-php-sdk
Python
pip install brevo-python
Java
For Maven-based projects, add the following dependency to your pom.xml file:
<dependency>
<groupId>io.brevo</groupId>
<artifactId>brevo-java-client</artifactId&n> <version>X.Y.Z</version> <!-- Replace with the latest version -->
</dependency>
Replace X.Y.Z with the latest Java SDK version as specified in the Sendinblue documentation. For Gradle, the dependency declaration would be similar within the build.gradle file.
Go
go get github.com/brevo/brevo-go
After installing the SDK, the next step involves configuring it with your API key. API keys are generated within the Sendinblue account dashboard and are essential for authenticating requests. It is recommended to store API keys securely, typically using environment variables, rather than hardcoding them directly into the application's source code. This practice aligns with general security principles for API credentials, as outlined in guides such as the OAuth 2.0 Bearer Token Usage specification, which emphasizes protecting access tokens.
Quickstart example
This quickstart example demonstrates sending a transactional email using the Node.js SDK. This is a common use case for Sendinblue, often employed for sending automated notifications, receipts, or password reset emails. Before running this code, ensure you have installed the Node.js SDK and have a valid Sendinblue API key.
const SibApiV3Sdk = require('sib-api-v3-sdk');
// Configure API key authorization: api-key
const defaultClient = SibApiV3Sdk.ApiClient.instance;
defaultClient.authentications['api-key'].apiKey = process.env.BREVO_API_KEY;
const apiInstance = new SibApiV3Sdk.TransactionalEmailsApi();
const sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
sendSmtpEmail.to = [{ email: '[email protected]', name: 'Recipient Name' }];
sendSmtpEmail.sender = { email: '[email protected]', name: 'Sender Name' };
sendSmtpEmail.subject = 'My Test Subject';
sendSmtpEmail.htmlContent = '<html><body><h1>This is a test email!</h1><p>Hello from Sendinblue.</p></body></html>';
sendSmtpEmail.textContent = 'This is a test email! Hello from Sendinblue.';
apiInstance.sendTransacEmail(sendSmtpEmail).then(function(data) {
console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, function(error) {
console.error(error);
});
In this example:
SibApiV3Sdk.ApiClient.instanceis used to configure the global API client.defaultClient.authentications['api-key'].apiKey = process.env.BREVO_API_KEY;sets your API key. It's crucial to retrieve this from an environment variable (process.env.BREVO_API_KEY) for security.SibApiV3Sdk.TransactionalEmailsApi()creates an instance of the API client specific to transactional emails.SibApiV3Sdk.SendSmtpEmail()creates an object to define the email's properties, including recipients, sender, subject, and content (both HTML and plain text).apiInstance.sendTransacEmail(sendSmtpEmail)executes the API call to send the email.- The
.then()and.catch()(or.function(error)in this older syntax) blocks handle the success and error responses, respectively.
For more advanced use cases, such as sending emails with dynamic templates, attachments, or tracking parameters, the Sendinblue SDKs offer additional methods and parameters. Developers can refer to the Sendinblue documentation on sending transactional emails for comprehensive guides and further examples in other supported languages.
Community libraries
While Sendinblue provides well-maintained official SDKs, the broader developer community may also contribute unofficial libraries or integrations. These community-driven projects can sometimes offer specialized functionalities, alternative API wrappers, or integrations with frameworks not directly supported by official SDKs. Examples might include custom wrappers for less common languages, plugins for specific CMS platforms, or utility libraries that build upon the core Sendinblue API for niche use cases.
When considering community libraries, it's important to evaluate their maintenance status, community support, and adherence to security best practices. Official SDKs generally receive direct support and updates from Sendinblue, ensuring compatibility with the latest API versions and features. Community projects, while valuable, may have varying levels of support and might not always keep pace with API changes. Developers should check the project's repository (e.g., GitHub) for recent activity, open issues, and contributor engagement before integrating them into production systems. Searching public package repositories like npm, PyPI, or RubyGems for packages related to "brevo" or "sendinblue" can reveal community contributions. Platforms like GitHub's topic pages related to Sendinblue can also be a good starting point for discovering community projects.
Before relying on a community library for critical operations, it's advisable to review its source code, understand its dependencies, and perform thorough testing. For core functionalities or high-volume transactional services, the official Sendinblue SDKs are generally the recommended choice due to their direct vendor support and guaranteed compatibility with the API.