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

@bokimo/email-sdk

v1.0.10

Published

Official TypeScript/JavaScript SDK for the Bokimo email & events API

Readme

@bokimo/sdk

Official TypeScript / JavaScript SDK for the Bokimo email & events API.


Installation

npm install @bokimo/sdk
# or
pnpm add @bokimo/sdk
# or
yarn add @bokimo/sdk

Requirements: Node.js ≥ 18 (uses the built-in fetch API).


Quick Start

import { BokimoClient } from "@bokimo/sdk";

const bokimo = new BokimoClient({
  baseUrl: "https://app.smler.in",  // or your self-hosted URL
  apiKey: process.env.BOKIMO_API_KEY!, // key from the Bokimo dashboard
});

Events

bokimo.events.emit(options)

Emit a named event that can trigger email workflows or other automations.

const result = await bokimo.events.emit({
  eventKey: "user.signup",
  payload: {
    userId: "abc123",
    plan: "pro",
  },
  userDetails: {
    email: "[email protected]",
    name: "Alice",
  },
  senderEmail: "[email protected]",
});

console.log(result.data.timestamp); // ISO timestamp

Options

| Property | Type | Required | Description | | ------------- | ----------------------------- | -------- | -------------------------------------------- | | eventKey | string | ✅ | Identifies which workflow(s) to trigger | | payload | Record<string, unknown> | ❌ | Arbitrary data forwarded to the workflow | | userDetails | { email: string; name?: string } | ✅ | Recipient details used by event-triggered emails | | senderEmail | string | ✅ | Verified sender address for triggered emails | | saveUser | boolean | ❌ | Reserved for future contact upsert support |


Emails

bokimo.emails.send(options)

Send a one-off email directly — no template required.

await bokimo.emails.send({
  from: "Acme <[email protected]>",
  to: "[email protected]",
  html: "<h1>Welcome to Acme!</h1><p>Thanks for signing up.</p>",
});

With multiple recipients, CC/BCC, and an attachment:

await bokimo.emails.send({
  from: "Acme <[email protected]>",
  to: ["[email protected]", "[email protected]"],
  cc: "[email protected]",
  html: "<p>Please find the invoice attached.</p>",
  attachments: [
    {
      filename: "invoice.pdf",
      content: "<base64-encoded-content>",
      encoding: "base64",
      contentType: "application/pdf",
    },
  ],
});

Options

| Property | Type | Required | Description | | ------------- | -------------------------------------- | -------- | ---------------------------------------- | | from | string | ✅ | Sender address / display name | | to | string \| string[] | ✅ | One or more recipient addresses | | html | string | ✅* | HTML body (html or text is required) | | text | string | ✅* | Plain-text body | | replyTo | string | ❌ | Reply-To address | | cc | string \| string[] | ❌ | CC recipients | | bcc | string \| string[] | ❌ | BCC recipients | | attachments | Attachment[] | ❌ | File attachments |


bokimo.emails.sendTemplate(options)

Send an email using a template saved in the Bokimo dashboard.

await bokimo.emails.sendTemplate({
  templateName: "welcome-email",
  from: "Acme <[email protected]>",
  to: "[email protected]",
  params: {
    firstName: "Alice",
    planName: "Pro",
    activationUrl: "https://acme.com/activate?token=xyz",
  },
});

Options

| Property | Type | Required | Description | | -------------- | ------------------------- | -------- | --------------------------------------------- | | templateName | string | ✅* | Name of the saved template (name or id) | | templateId | string | ✅* | Numeric ID of the saved template | | from | string | ✅ | Sender address / display name | | to | string \| string[] | ✅ | One or more recipient addresses | | replyTo | string | ❌ | Reply-To address | | cc | string \| string[] | ❌ | CC recipients | | bcc | string \| string[] | ❌ | BCC recipients | | params | Record<string, unknown> | ❌ | Variables interpolated into the template |


Error Handling

All methods throw a BokimoApiError on non-2xx responses.

import { BokimoClient, BokimoApiError } from "@bokimo/sdk";

try {
  await bokimo.events.emit({
    eventKey: "user.signup",
    userDetails: { email: "[email protected]" },
    senderEmail: "Acme <[email protected]>",
  });
} catch (err) {
  if (err instanceof BokimoApiError) {
    console.error(`API error ${err.status}:`, err.body);
  }
}

BokimoApiError properties

| Property | Type | Description | | -------- | -------------- | ------------------------- | | status | number | HTTP status code | | body | ApiErrorBody | Parsed JSON error payload | | message| string | Human-readable message |


Building from Source

cd sdk
pnpm install
pnpm build        # compiles to dist/
pnpm typecheck    # type-check without emitting

License

MIT