bởi Esme R.

A full-featured Node.js wrapper for the SendinBlue (Brevo) API v3, covering contacts, email campaigns, transactional messages, CRM deals, conversations, and more. Built for backend developers integrating marketing automation into Node.js applications.
This block provides a complete Node.js client for the SendinBlue (Brevo) transactional and marketing API v3, covering email campaigns, SMS, contacts, webhooks, senders, and more. It is auto-generated from the OpenAPI v2 spec and maintained by SendinBlue. Typical buyers are backend Node.js or TypeScript developers who need programmatic control over email delivery, contact management, or campaign automation.
Deprecation notice: The upstream package
sib-api-v3-sdkis deprecated. The successor is@getbrevo/brevo. This block ships the v8.5.0 source as-is.
api/ - One file per API resource group (AccountApi, ContactsApi, TransactionalEmailsApi, etc.)model/ - Request/response model classes (CreateContact, CreateSmtpEmail, GetEmailCampaigns, etc.)ApiClient.js - Core HTTP client: authentication, serialization, request execution via superagentindex.js - Barrel export: re-exports every API class and model for single-import accessapi/AccountApi.js - Account information retrievalapi/CompaniesApi.js - CRM company CRUD operationsapi/ContactsApi.js - Contact list, attribute, and segment managementapi/ConversationsApi.js - Live chat conversation messagingapi/DealsApi.js - CRM deal pipeline operationsapi/EmailCampaignsApi.js - Email campaign creation, scheduling, reportingapi/FilesApi.js - File attachment managementapi/InboundParsingApi.js - Inbound email parsing configurationapi/MasterAccountApi.js - Master account and sub-account managementapi/NotesApi.js - CRM note managementapi/ProcessApi.js - Background process status queriesapi/ResellerApi.js - Reseller and child account managementapi/SMSCampaignsApi.js - SMS campaign creation and schedulingapi/SendersApi.js - Sender address and IP managementapi/TasksApi.js - CRM task managementapi/TransactionalEmailsApi.js - Send transactional emails, manage templates and SMTP logsKhởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
This JavaScript cli / script completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 7d3d2ff6cc946f74…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
api/TransactionalSMSApi.js - Send transactional SMS messagesapi/WebhooksApi.js - Webhook creation and managementnpm install superagent querystring
No native modules, no iOS pod install, no Android linking, no npx expo prebuild required. This is a pure Node.js library.
Copy the source/ directory into your project, e.g. src/lib/sib-api-v3-sdk/.
No TypeScript declarations are shipped. If you use TypeScript, add a shim or install the community types:
npm install --save-dev @types/superagent
For the SDK itself, create src/lib/sib-api-v3-sdk/index.d.ts with declare const sdk: any; export = sdk; as a minimal workaround, or use // @ts-ignore on the require line.
Configure your API key via environment variable (do not hardcode):
export SIB_API_KEY="your-sendinblue-api-key"
Wire the client in your entry point (CommonJS):
const SibApiV3Sdk = require('./lib/sib-api-v3-sdk/index');
const defaultClient = SibApiV3Sdk.ApiClient.instance;
defaultClient.authentications['api-key'].apiKey = process.env.SIB_API_KEY;
For TypeScript projects using ts-node or compiled output, set "esModuleInterop": true and "allowSyntheticDefaultImports": true in tsconfig.json to avoid CJS/ESM interop issues.
If you use path aliases, add the following to tsconfig.json:
{
"compilerOptions": {
"paths": {
"sib-sdk/*": ["src/lib/sib-api-v3-sdk/*"]
}
}
}
const client: {
instance: ApiClient;
authentications: {
'api-key': { apiKey: string; apiKeyPrefix?: string };
'partner-key': { apiKey: string; apiKeyPrefix?: string };
};
};
The singleton HTTP client that all API classes share. Set ApiClient.instance.authentications['api-key'].apiKey once at startup and every subsequent API call inherits the credential. Supports optional apiKeyPrefix for token-based auth schemes.
class TransactionalEmailsApi {
sendTransacEmail(sendSmtpEmail: CreateSmtpEmail): Promise<CreateSmtpEmailResponse>;
getEmailEventReport(opts?: object): Promise<GetEmailEventReport>;
getSmtpTemplates(opts?: object): Promise<GetSmtpTemplates>;
}
Use this class to send one-off transactional emails (password resets, receipts, notifications) and to query SMTP delivery logs. Pass a CreateSmtpEmail model instance as the body. Returns a promise with the message ID on success.
class ContactsApi {
createContact(createContact: CreateContact): Promise<CreateUpdateContactModel>;
getContacts(opts?: object): Promise<GetContacts>;
updateContact(identifier: string, updateContact: UpdateContact): Promise<void>;
deleteContact(identifier: string): Promise<void>;
addContactToList(listId: number, contactEmails: AddContactToList): Promise<PostContactInfo>;
}
Use this class to manage the contacts database: create subscribers, update attributes, add to lists, and remove contacts. identifier is the contact's email address or numeric ID.
class EmailCampaignsApi {
createEmailCampaign(emailCampaigns: CreateEmailCampaign): Promise<CreateModel>;
sendEmailCampaignNow(campaignId: number): Promise<void>;
getEmailCampaigns(opts?: object): Promise<GetEmailCampaigns>;
updateEmailCampaign(campaignId: number, emailCampaign: UpdateEmailCampaign): Promise<void>;
}
Use this class to build and dispatch bulk marketing campaigns. Create a campaign with template and recipient list IDs, then call sendEmailCampaignNow to dispatch immediately or schedule via scheduledAt in the create body.
Configure the client once, construct a CreateSmtpEmail model, and call sendTransacEmail. Suitable for triggered emails such as order confirmations.
const SibApiV3Sdk = require('./lib/sib-api-v3-sdk/index');
const defaultClient = SibApiV3Sdk.ApiClient.instance;
defaultClient.authentications['api-key'].apiKey = process.env.SIB_API_KEY!;
const api = new SibApiV3Sdk.TransactionalEmailsApi();
const sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail();
sendSmtpEmail.to = [{ email: 'recipient@example.com', name: 'Jane Doe' }];
sendSmtpEmail.sender = { name: 'My App', email: 'user@example.com' };
sendSmtpEmail.subject = 'Order Confirmed';
sendSmtpEmail.htmlContent = '<p>Your order has been confirmed.</p>';
api.sendTransacEmail(sendSmtpEmail)
.then((data: any) => console.log('Sent, messageId:', data.messageId))
.catch((err: any) => console.error('Error:', err.response?.text));
Create a new contact with custom attributes, then add them to an existing list by numeric list ID.
const SibApiV3Sdk = require('./lib/sib-api-v3-sdk/index');
const defaultClient = SibApiV3Sdk.ApiClient.instance;
defaultClient.authentications['api-key'].apiKey = process.env.SIB_API_KEY!;
const contactsApi = new SibApiV3Sdk.ContactsApi();
const createContact = new SibApiV3Sdk.CreateContact();
createContact.email = 'newuser@example.com';
createContact.attributes = { FIRSTNAME: 'Alice', LASTNAME: 'Smith' };
createContact.listIds = [5];
contactsApi.createContact(createContact)
.then((data: any) => {
console.log('Contact created, id:', data.id);
const addToList = new SibApiV3Sdk.AddContactToList();
addToList.emails = ['newuser@example.com'];
return contactsApi.addContactToList(7, addToList);
})
.then(() => console.log('Added to list 7'))
.catch((err: any) => console.error(err.response?.text));
Build a campaign pointing to an existing template and recipient list, then dispatch it immediately.
const SibApiV3Sdk = require('./lib/sib-api-v3-sdk/index');
const defaultClient = SibApiV3Sdk.ApiClient.instance;
defaultClient.authentications['api-key'].apiKey = process.env.SIB_API_KEY!;
const campaignsApi = new SibApiV3Sdk.EmailCampaignsApi();
const campaignBody = new SibApiV3Sdk.CreateEmailCampaign();
campaignBody.name = 'Monthly Newsletter - June';
campaignBody.subject = 'June Update from MyApp';
campaignBody.sender = { name: 'MyApp Team', email: 'user@example.com' };
campaignBody.templateId = 12;
campaignBody.recipients = { listIds: [3] };
campaignsApi.createEmailCampaign(campaignBody)
.then((data: any) => {
console.log('Campaign created, id:', data.id);
return campaignsApi.sendEmailCampaignNow(data.id);
})
.then(() => console.log('Campaign dispatched'))
.catch((err: any) => console.error(err.response?.text));
index.js - Single barrel that requires and re-exports every API class and model; start every import from here.ApiClient.js - Handles HTTP transport, auth header injection, query param serialization, and superagent request lifecycle.api/AccountApi.js - Wraps GET /account to retrieve plan and usage information.api/ContactsApi.js - Full contact CRUD: create, read, update, delete, list management, and attribute definitions.api/TransactionalEmailsApi.js - Send SMTP emails, manage templates, query delivery events and statistics.api/TransactionalSMSApi.js - Send one-off SMS messages and retrieve SMS logs.api/EmailCampaignsApi.js - Campaign lifecycle: create, update, schedule, send, and fetch reports.api/SMSCampaignsApi.js - SMS campaign creation, scheduling, and statistics.api/SendersApi.js - Manage verified sender addresses and dedicated IPs.api/WebhooksApi.js - Register and manage event webhooks for email and SMS events.api/ResellerApi.js - Child account creation, credit allocation, and plan management for resellers.api/MasterAccountApi.js - Sub-account provisioning and SSO token generation.api/CompaniesApi.js - CRM company record CRUD.api/DealsApi.js - CRM deal pipeline CRUD.api/NotesApi.js - CRM note attachment to contacts, companies, or deals.api/TasksApi.js - CRM task creation and status tracking.api/FilesApi.js - Upload and retrieve files attached to CRM records.api/ConversationsApi.js - Push messages into live chat conversation threads.api/InboundParsingApi.js - Configure inbound email parsing routes.api/ProcessApi.js - Poll status of long-running asynchronous API processes.model/ - Plain JS classes with constructFromObject factory methods, matching every request and response schema in the API.SIB_API_KEY not set at startup: ApiClient.instance is a module-level singleton; set the key before constructing any API class, not after.module.exports; set "esModuleInterop": true in tsconfig.json and use require() or import * as SibApiV3Sdk from '...'.superagent version mismatch: The SDK was written against superagent v5/v6. If your project pins v8+, check for breaking changes in callback vs. promise API; downgrade to superagent@6 if errors appear..catch(err => err.response.text) to read the JSON error from SendinBlue rather than the raw Error object.listIds must be numeric arrays, not strings: Passing listIds: ['3'] silently fails validation; always use listIds: [3].Retry-After.I have dropped the SendinBlue API v3 Node.js SDK source into `src/lib/sib-api-v3-sdk/`.
The entry point is `src/lib/sib-api-v3-sdk/index.js`.
The upstream npm package this source corresponds to is `user@example.com`.
There is a USAGE.md file in this block that documents all real exports, working code
examples, and setup steps.
Please help me integrate this SDK into my existing Node.js/TypeScript project step by step:
1. Read USAGE.md and the file listing under `src/lib/sib-api-v3-sdk/` to understand
what is available.
2. Add `superagent` and `querystring` to my package.json dependencies.
3. Create a singleton setup module at `src/services/sibClient.ts` that reads
`SIB_API_KEY` from `process.env` and configures `ApiClient.instance`.
4. Implement [describe your specific feature, e.g. "a function that sends a
transactional email given a recipient address, subject, and HTML body"].
5. Use only the real classes from `src/lib/sib-api-v3-sdk/index.js` - do not
invent class or method names. Refer to USAGE.md for correct signatures.
6. Add error handling that logs `err.response.text` for API errors.
7. Show me the final files and any tsconfig.json changes needed.
The upstream SDK is published under the MIT License (see source/LICENSE if present, or refer to the npm package page).
Upstream package: user@example.com by SendinBlue.
Migration target: @getbrevo/brevo on GitHub at github.com/getbrevo/brevo-node.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
Automation, Utilities & Developer Tools
Miễn phí