
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
This SDK enables the integration of the Sendlix API into NodeJS applications. It provides clients for email sending, group management, and other functionalities.
Install the SDK via npm:
npm install sendlix
Import the SDK into your project:
import { EmailClient, GroupClient, IAuth } from "sendlix";
The SDK uses an API key for authentication. The API key must be in the format secret.keyId
(When you copy it from the dashboard, it's already in the correct format). There are two options:
Passing an API key string:
const emailClient = new EmailClient("sk_xxxxxxxxx.xxx");
Using an IAuth instance:
import { Auth } from "sendlix-nodejs-sdk";
const auth: IAuth = new Auth("sk_xxxxxxxxx.xxx");
const emailClient = new EmailClient(auth);
const groupClient = new GroupClient(auth);
We recommend using the second option when you want to use both clients. This way, the auth token is only requested once and passed to both clients.
The EmailClient allows you to send emails, both standardized emails and pre-formatted EML messages.
sendEmail(sendMail, additionalOptions?)
Sends a configured email.
sendRawEmail(eml, additionalOptions?)
Sends an EML file or EML string.
sendGroupEmail(content, from, groupId, subject)
Sends an email to a defined group.
sendEmailWithTracking(sendMail, additionalOptions?)
Sends an email with tracking for clicks and opens.
The GroupClient allows you to add email addresses to groups or remove them from groups.
insertEmailIntoGroup(groupId, email, substitutions?)
Adds one or more email addresses to a group.
deleteEmailFromGroup(groupId, email)
Removes an email address from a group. Note: The email must be in the group for at least 30 minutes.
containsEmailInGroup(groupId, email)
Checks if an email address is in a group.
import { EmailClient } from "sendlix-nodejs-sdk";
// Initialize client
const client = new EmailClient("sk_xxxxxxxxx.xxx");
// Email configuration
const sendMail = {
from: { email: "sender@example.com", name: "Sender Name" },
to: [{ email: "recipient@example.com", name: "Recipient Name" }],
subject: "Hello World!",
content: {
value: "<h1>Welcome!</h1><p>This is a test email.</p>",
type: "html",
},
};
// Send email
client
.sendEmail(sendMail)
.then((response) => {
console.log("Email sent:", response);
})
.catch((error) => {
console.error("Error sending email:", error);
});
import { GroupClient } from "sendlix-nodejs-sdk";
// Initialize client
const groupClient = new GroupClient("sk_xxxxxxxxx.xxx");
groupClient
.insertEmailIntoGroup("groupId123", "recipient@example.com")
.then((success) => {
console.log("Email added to group:", success);
})
.catch((error) => {
console.error("Error adding email to group:", error);
});
Contributions to the SDK are welcome. Please use Issues and Pull Requests to report bugs or suggest new features.
For questions or problems, please contact Sendlix support or refer to the appropriate community forums.
This SDK was developed to facilitate the use of the Sendlix API in NodeJS applications. Follow the Sendlix Documentation for more details about the API endpoints and advanced configuration options.
FAQs
Send emails using Sendlix API
The npm package sendlix receives a total of 7 weekly downloads. As such, sendlix popularity was classified as not popular.
We found that sendlix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.