npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@samva/email-sdk

v0.1.1

Published

Samva community adapter for Email SDK.

Readme

@samva/email-sdk

Provider-owned Samva community adapter for Email SDK. It targets @opencoredev/email-sdk@^1.1.0 and samva@^0.3.0.

This adapter is maintained by Samva as a community integration; it is not an official built-in Email SDK adapter.

Install

bun add @samva/email-sdk @opencoredev/email-sdk samva

Register the adapter

Keep the Samva API key on the server. The package does not read environment variables or load .env files.

import { createEmailClient } from "@opencoredev/email-sdk";
import { samva } from "@samva/email-sdk";

const email = createEmailClient({
  adapters: [samva({ apiKey: process.env.SAMVA_API_KEY! })],
});

const result = await email.send({
  from: "Samva <[email protected]>",
  to: "[email protected]",
  subject: "Welcome",
  html: "<p>Your workspace is ready.</p>",
  text: "Your workspace is ready.",
});

console.log(result.adapter, result.id);

You can also register the adapter through a plugin:

import { createEmailClient } from "@opencoredev/email-sdk";
import { samvaPlugin } from "@samva/email-sdk";

const email = createEmailClient({
  plugins: [samvaPlugin({ apiKey: process.env.SAMVA_API_KEY! })],
});

samva() also accepts baseUrl, fetch, and headers, or a preconfigured Samva Promise client. An API key is required unless a client is injected.

Field support

| Email SDK input | Behavior | | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | from, to, cc, bcc | Bare, display-form, and object addresses become Samva address objects; malformed or ambiguous forms are rejected. | | replyTo | Bare addresses are forwarded. Display names are rejected because Samva cannot preserve them. | | subject, html, text | Forwarded without rewriting. | | metadata | Forwarded to Samva message metadata. | | In-memory attachments | Raw or base64 strings, Uint8Array, ArrayBuffer, and Blob become base64 with exact byte size. contentType is required. | | headers, tags, sendAt | Rejected before the Samva client is called. | | Attachment path, contentId, disposition | Rejected before the Samva client is called. URL attachment paths are not supported. | | Send idempotencyKey | Rejected before the Samva client is called. |

Capabilities are declared exactly as follows:

{
  repeatedHeaders: false,
  idempotency: "none",
  scheduling: false,
  personalized: "expanded",
}

Email SDK expands personalized sends into one Samva call per recipient. The adapter intentionally has no native sendPersonalized method.

Results and failures

Successful sends return { adapter: "samva", id, raw }. raw is the Samva message result. Recipient queue states are not converted into final accepted or rejected delivery claims.

Unsupported or lossy input throws EmailValidationError without calling Samva. API and transport failures become a redacted EmailAdapterError with status and x-request-id when available. Retryability is enabled for statuses 408, 409, 425, 429, and 5xx. Ambiguous transport, server, and malformed-success outcomes use delivery: "unknown"; fallback therefore stops unless the application explicitly opts into continuing after unknown delivery.

Abort signals are forwarded to the Samva Promise client and retain Email SDK's EmailAbortError behavior. The adapter send path uses Web APIs and has no node:* imports.

See Email SDK's fallback and retry model before composing multiple adapters.

More examples

License

MIT