SDKs Overview

sevk ships official SDKs for eight languages with aligned resources and API coverage.

Languages

Each SDK is published to the native package registry for its ecosystem. Pick your language:

  • Node.js / Bun: sevk on npm (docs)
  • Python: sevk on PyPI (docs)
  • PHP: sevk/sevk-php on Packagist (docs)
  • Ruby: sevk on RubyGems (docs)
  • Go: github.com/sevk-io/sevk-go (docs)
  • Rust: sevk on crates.io (docs)
  • Java: io.sevk:sevk-java on Maven Central (docs)
  • .NET: Sevk on NuGet (docs)

Install

Node.js / Bun
npm install sevk
Python
pip install sevk
PHP
composer require sevk/sevk-php
Ruby
gem install sevk
Go
go get github.com/sevk-io/sevk-go
Rust
cargo add sevk
Java (Maven)
<dependency>
<groupId>io.sevk</groupId>
<artifactId>sevk-java</artifactId>
<version>1.1.0</version>
</dependency>
.NET
dotnet add package Sevk

Initialize

Every SDK requires your API key. Grab one from the sevk dashboard under API Keys. The key is always passed explicitly; no SDK reads it from the environment.

Node.js
import { Sevk } from 'sevk'
const sevk = new Sevk('sevk_full_xxxxxxxx')
Python
from sevk import Sevk
sevk = Sevk("sevk_full_xxxxxxxx")
Go
sevk := sevk.New("sevk_full_xxxxxxxx")

Resources

Every SDK covers the same resources. Method names and casing follow each language's conventions.

  • sevk.emails: send, get, update, cancel, sendBulk
  • sevk.contacts: create, get, update, delete, list, bulkImport (bulk_import in Python/Ruby, BulkImport in Go/.NET), bulkUpdate, activity
  • sevk.audiences: create, get, update, delete, list, addContacts, listContacts, removeContact
  • sevk.broadcasts: list, get, create, update, delete, send, cancel, test, analytics, status, emails, estimateRecipients, estimateCost, active
  • sevk.domains: list, get, create, update, delete, verify, verifyInbound, dnsRecords, regions
  • sevk.templates: list, get, create, update, delete, duplicate
  • sevk.topics: scoped to an audience
  • sevk.segments: scoped to an audience, preview before saving
  • sevk.subscriptions: subscribe, unsubscribe
  • sevk.webhooks: list, get, create, update, delete, test, events
  • sevk.inbound: list, get, downloadAttachment, routes, blocklist, quota, security
  • sevk.outbound: getQuota, updateQuota, pause, reset
  • sevk.activity: list, stats
  • sevk.usage: get

Your First Send

Node.js
import { Sevk } from 'sevk'
const sevk = new Sevk(process.env.SEVK_API_KEY!)
const { id } = await sevk.emails.send({
subject: 'First send',
text: 'It worked.'
})
console.log(id)
Python
import os
from sevk import Sevk
sevk = Sevk(os.environ["SEVK_API_KEY"])
email = sevk.emails.send({
"from": "[email protected]",
"subject": "First send",
"text": "It worked.",
})
print(email["id"])

Scheduled Email

All eight SDKs support scheduled transactional email through the single-send method, followed by reschedule or cancel operations on the returned email id. The timestamp must include a timezone, be in the future, and be no more than 30 days ahead. Attachments and bulk scheduling are not supported. Quota and balance are reserved at acceptance and released on cancellation.

NameTypeDescription
Node.js / PHP / JavascheduledAtRFC 3339 string on the single-send request.
Python / Ruby / Rustscheduled_atRFC 3339 string; serialized as scheduledAt.
GoScheduledAt*string on SendEmailParams.
.NETScheduledAtstring on SendEmailRequest.

See the Node.js and Python lifecycle examples, plus the reschedule and cancel references. Changes are rejected after provider delivery starts. For safe send retries, persist the schedule with the payload and reuse the original idempotency key.

Errors

API failures, local request validation, and connection failures use each language's SDK error type. Catch that base type to handle request failures in one place. Use the machine code to distinguish validation, timeout, and connection errors.

Local validation uses VALIDATION_ERROR; timeouts use TIMEOUT, and connection failures use NETWORK_ERROR. Local validation sends no HTTP request. The status is 0 when unavailable, or None in Rust. API responses retain their actual HTTP status and any field details or retry delay supplied by the server.

Node.js
import { SevkError, RateLimitError } from 'sevk'
try {
await sevk.emails.send({ /* ... */ })
} catch (err) {
if (!(err instanceof SevkError)) {
throw err
}
console.error(err.code, err.statusCode, err.message, err.fields)
if (err instanceof RateLimitError) {
console.error(err.retryAfter)
}
}

Types

Node/TypeScript ships typings in the package. Go, Rust, Java and .NET are statically typed.