Constructs a new GroupClient instance.
Optionalauth: string | IAuth
Authentication object implementing IAuth or a raw token string.
Closes the client connection Should be called when the client is no longer needed to free resources
Checks whether an email exists in a group.
The unique identifier of the group.
The email address to check.
Promise that resolves to true if the email exists in the group; false otherwise.
Deletes an email from a group.
Important: Emails can only be removed if they were added at least 30 minutes ago.
The unique identifier of the group.
The email address to remove from the group.
Promise that resolves to true on success, otherwise rejects with an Error.
Inserts one or multiple email records into a group.
The unique identifier of the group.
A single EmailRecord or an array of EmailRecord objects.
Strategy on individual insert failure. One of the keys of FailureHandler (e.g. "ABORT").
Promise that resolves to true on success, otherwise rejects with an Error.
const client = new GroupClient("your_api_key");
// Single email as simple string
await client.insertEmailIntoGroup("groupId", { email: "info@example.com" });
// With display name and substitutions
await client.insertEmailIntoGroup("groupId", {
email: { email: "john@example.com", name: "John Doe" },
substitutions: { firstName: "John" }
});
// Multiple records
await client.insertEmailIntoGroup("groupId", [
{ email: "a@example.com" },
{ email: { email: "b@example.com", name: "User B" }, substitutions: { plan: "pro" } },
]);
GroupClient is a client for managing group operations via gRPC. It provides methods for inserting and deleting emails from groups.