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

@volara/sdk

v0.1.0

Published

Official TypeScript/JavaScript SDK for the Volara API — messaging, conversations, CRM, broadcasts, knowledge, metrics, and agency white-label. Works in Node 18+, browsers, and Cloudflare Workers.

Downloads

76

Readme

@volara/sdk

The official TypeScript/JavaScript SDK for Volara — send WhatsApp and omnichannel messages, manage conversations and contacts, run broadcasts, search your knowledge base, read metrics, and (for agencies) manage white-label client orgs.

One small, typed, dependency-free client that runs anywhere fetch does: Node 18+, browsers, and Cloudflare Workers / edge.

Install

npm install @volara/sdk
# or
pnpm add @volara/sdk
# or
bun add @volara/sdk

Authentication

Create a developer API key in your Volara dashboard. The key carries your tenant and scope, so the SDK just sends it on every request.

import { Volara } from '@volara/sdk'

// Pass it explicitly...
const volara = new Volara({ apiKey: 'sk_live_xxx' })

// ...or set VOLARA_API_KEY and let the SDK pick it up.
const volara2 = new Volara()

Self-hosting or using a regional endpoint? Override the base URL:

const volara = new Volara({ apiKey: '...', baseUrl: 'https://api.your-region.volara.chat' })

Quickstart — send a message in under 5 lines

import { Volara } from '@volara/sdk'

const volara = new Volara({ apiKey: process.env.VOLARA_API_KEY })
await volara.messages.send({ conversationId: 'conv_123', text: 'Halo 👋' })

Examples

Conversations

const { data, total } = await volara.conversations.list({ status: 'open', perPage: 20 })
const conversation = await volara.conversations.get('conv_123')

// Auto-paging — iterate every conversation without managing page numbers.
for await (const c of volara.conversations.iterate({ status: 'open' })) {
  console.log(c.id, c.status)
}

Messages

await volara.messages.send({ conversationId: 'conv_123', text: 'Your order shipped!' })

// Richer payloads (templates, media) pass through as the API documents them.
await volara.messages.send({
  conversationId: 'conv_123',
  type: 'template',
  content: { name: 'order_update', language: 'id', variables: ['#A123'] },
})

Contacts (CRM)

const { data } = await volara.contacts.list({ q: 'budi', perPage: 50 })
const contact = await volara.contacts.create({
  name: 'Budi Santoso',
  phoneNumber: '+6281234567890',
  email: '[email protected]',
})

for await (const c of volara.contacts.iterate()) {
  // process every contact
}

Broadcasts

const { data } = await volara.broadcasts.list()
const broadcast = await volara.broadcasts.create({
  title: 'Ramadan Promo',
  messageContent: 'Diskon 30% minggu ini!',
})

Knowledge base

const sources = await volara.knowledge.search('refund policy')                 // sources (default)
const faqs = await volara.knowledge.search('how to track order', { scope: 'faqs' })
// or the explicit helpers:
await volara.knowledge.sources('shipping')
await volara.knowledge.faqs('returns')

Metrics

const dashboard = await volara.metrics.dashboard()

Agency (white-label)

Requires an agency-scoped API key.

const clients = await volara.agency.clients.list()
const overview = await volara.agency.overview()
const newClient = await volara.agency.clients.createOrg({ name: 'Acme Retail' })

Escape hatch

Need an endpoint the SDK doesn't model yet? Call it directly under /api/v1:

const tickets = await volara.request('/tickets', { query: { status: 'open' } })
const raw = await volara.raw('/something', { method: 'POST', body: { ... } }) // no envelope unwrap

Error handling

Every non-2xx response, timeout, and network failure throws a typed VolaraError. Always log the requestId — it lets Volara support trace the exact call.

import { Volara, VolaraError } from '@volara/sdk'

try {
  await volara.conversations.get('missing')
} catch (err) {
  if (err instanceof VolaraError) {
    console.error(err.status)    // e.g. 404
    console.error(err.code)      // e.g. "VLR-..." (when the API sends one)
    console.error(err.requestId) // include this in support tickets
    console.error(err.message)
  }
}

VolaraTimeoutError and VolaraConnectionError are subclasses of VolaraError, so a single catch (err instanceof VolaraError) covers everything.

Resilience

The client handles the boring parts for you:

  • Retries on 429 and 5xx (and network blips) with exponential backoff + jitter, honoring the Retry-After header. Tune with maxRetries (default 2).
  • Timeouts via AbortSignal.timeout. Tune with timeoutMs (default 30000).
  • Idempotency keys auto-attached to every write (POST/PUT/PATCH/DELETE) so retries can't double-create. Override per call by passing idempotencyKey.
const volara = new Volara({ apiKey: '...', timeoutMs: 10_000, maxRetries: 4 })

Webhook verification

Verify incoming webhooks with HMAC-SHA256. The helper uses Web Crypto, so it works in Node, the browser, and Workers — and does a constant-time comparison.

import { verifyWebhook } from '@volara/sdk/webhooks'

// Read the RAW body and verify BEFORE parsing — re-serializing changes the bytes.
const raw = await request.text()
const ok = await verifyWebhook({
  payload: raw,
  signature: request.headers.get('x-volara-signature') ?? '',
  secret: process.env.VOLARA_WEBHOOK_SECRET,
})
if (!ok) return new Response('invalid signature', { status: 401 })

const event = JSON.parse(raw)
if (event.type === 'message.received') {
  // ...
}

Edge / Cloudflare Workers

No configuration needed — the SDK uses the global fetch and Web Crypto, both of which Workers provide. If your runtime lacks a global fetch, inject one:

const volara = new Volara({ apiKey: '...', fetch: myFetch })

TypeScript

Ships ESM + CommonJS builds and full type declarations. Response record shapes are intentionally permissive (extra server fields never break your build); they tighten up as the Volara OpenAPI v1 spec is frozen.

License

MIT