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 🙏

© 2025 – Pkg Stats / Ryan Hefner

dialnexa

v1.0.3

Published

JavaScript SDK for dialnexa APIs

Readme

dialnexa JavaScript SDK (TypeScript)

TypeScript-based JavaScript SDK for dialnexa APIs. It provides small, fetch-based helpers (via a single client factory) for:

  • Languages
  • LLMs
  • Calls
  • Batch Calls (file upload)
  • Agents v2
  • Voices

The SDK targets ESM (Node 18+). Source lives in src, build output in dist/.

Requirements

  • Node.js 18+
  • npm

Getting Started

  1. Install deps and build
npm install
npm run build
  1. Set environment variables

You can use a .env file or set them in your shell. Required:

  • DIALNEXA_API_KEY

PowerShell (Windows):

$env:DIALNEXA_API_KEY = '<your_api_key>'

bash/zsh:

export DIALNEXA_API_KEY='<your_api_key>'

Importing

After npm run build, import the client factory from the package root and use the namespaced helpers.

import { createClient } from 'dialnexa';

const dialnexa = createClient({
  apiKey: process.env.DIALNEXA_API_KEY,
});

API Overview

Below are minimal examples using the client. Configure apiKey, optional baseUrl, and timeoutMs when creating the client.

Languages

const languages = await dialnexa.languages.list();
const en = await dialnexa.languages.get('en-US');

LLMs

const llms = await dialnexa.llms.list();
const DEFAULT_LLM_ID = 'llm_123';
const one = await dialnexa.llms.get(DEFAULT_LLM_ID);

Calls

// List calls with pagination
const calls = await dialnexa.calls.list({ page: 1, limit: 30 });

const PHONE = '+15555551234';
const AGENT_ID = 'agent_123';
const AGENT_VERSION_NUMBER = 1;
const created = await dialnexa.calls.create({
  phone_number: PHONE,
  agent_id: AGENT_ID,
  agent_version_number: AGENT_VERSION_NUMBER,
  metadata: { source: 'sdk' },
});

const call = await dialnexa.calls.get(created.call_id);

Batch Calls

import fs from 'node:fs';

const stream = fs.createReadStream('./leads.csv');

const TITLE = 'My Campaign';
const AGENT_ID = 'agent_123';
const AGENT_VERSION_NUMBER = 1;

const resp = await dialnexa.batchCalls.create({
  file: stream,
  filename: 'leads.csv',
  title: TITLE,
  agentId: AGENT_ID,
  agentVersionNumber: AGENT_VERSION_NUMBER,
});

Agents

const created = await dialnexa.agents.create({
  title: 'Customer Support Agent',
  prompts: {
    prompt_text: 'Hello!',
    welcome_message: 'Welcome! I\'m here to help.',
    conversation_start_type: 'user',
  },
});

const listed = await dialnexa.agents.list();
const one = await dialnexa.agents.get(created.data?.id ?? created.data?.agent_id);

const updated = await dialnexa.agents.update(created.data?.id ?? created.data?.agent_id, {
  version_number: 1,
  title: 'Updated Title',
});

Voices

const list = await dialnexa.voices.list({ provider_name: 'elevenlabs', limit: 10 });
const VOICE_ID = 'voice_abc';
const voice = await dialnexa.voices.get(VOICE_ID);

Running Examples

All examples are under examples/ (ESM). Build the SDK first (npm run build).

node examples/languages.mjs [voiceModelId] [languageId]
node examples/llms.mjs [page] [limit] [sortBy] [sortOrder] [id]
node examples/calls.mjs [page] [limit] [phoneToCreateOrNull]
node examples/batch-calls.mjs <file_path>
node examples/agents.mjs
node examples/voices.mjs [voiceId]

Project Layout

  • src/ — TypeScript source
  • dist/ — compiled JS/typings (generated by npm run build)
  • examples/ — runnable example scripts

Publishing

  • dist/ is ignored by Git but included in npm via the files field.
  • prepublishOnly runs npm run build automatically before publishing.

Troubleshooting

  • Ensure Node 18+ and ESM are used (package type: module).
  • For file uploads in Node, pass a ReadStream, Buffer, Uint8Array, or Blob.

License

MIT