SDKs & plugins
Official SDKs
Brevo's SDKs accept a base URL: that is the only change. The key is sent in the api-key
header, as with Brevo (see API keys).
Node.js: @getbrevo/brevo (verified end-to-end with version 6.0.3)
import { BrevoClient } from "@getbrevo/brevo";
const brevo = new BrevoClient({
apiKey: process.env.BREVO_API_KEY!,
baseUrl: "https://my-shop.com/api/brevo/v3",
});
const contact = await brevo.contacts.getContactInfo({ identifier: "jane@example.com" });
await brevo.transactionalEmails.sendTransacEmail({
templateId: 3,
to: [{ email: "jane@example.com" }],
params: { orderId: 42 },
});
PHP: getbrevo/brevo-php, version 5.x (the baseUrl option replaces the default address)
use Brevo\Brevo;
$brevo = new Brevo(
apiKey: getenv('BREVO_API_KEY'),
options: ['baseUrl' => 'https://my-shop.com/api/brevo/v3'],
);
$contact = $brevo->contacts->getContactInfo('jane@example.com');
With the legacy 1.x PHP SDK, set the URL with setHost:
$config = Brevo\Client\Configuration::getDefaultConfiguration()
->setApiKey('api-key', getenv('BREVO_API_KEY'))
->setHost('https://my-shop.com/api/brevo/v3');
$api = new Brevo\Client\Api\TransactionalEmailsApi(new GuzzleHttp\Client(), $config);
Python / others: any HTTP client works. Replace https://api.brevo.com/v3 with
https://<site-domain>/api/brevo/v3 and keep the api-key header.
SDK methods that target a part of the API that is not implemented (campaigns, SMS,
WhatsApp, CRM…) get a 404 error with the code document_not_found. A missing or revoked
key gets 401 with the code unauthorized. The list of available operations is in
Compatibility.
CMS plugins
Brevo's WordPress, WooCommerce, PrestaShop and Magento plugins hardcode api.brevo.com.
For WordPress, a must-use plugin reroutes their calls without modifying the plugin (drop it in
wp-content/mu-plugins/):
<?php
add_filter('pre_http_request', function ($pre, $args, $url) {
$new = preg_replace('#^https://api\.(brevo|sendinblue)\.com/v3/#', 'https://my-shop.com/api/brevo/v3/', $url);
return $new === $url ? $pre : wp_remote_request($new, $args);
}, 10, 3);
This filter only works for plugins that use WordPress's HTTP functions (wp_remote_*).
The plugins have not been checked line by line: test with the version you run. PrestaShop
and Magento modules use their own HTTP client and need an override of the module's base-URL
constant.