npm.io
1.0.0 • Published 20h ago

spik-sdk

Licence
MIT
Version
1.0.0
Deps
0
Size
8 kB
Vulns
0
Weekly
0

Spik SDK Node.js Client

Official Node.js SDK client library for the Spik.ai conversational AI platform.

Installation

Install via npm:

npm install spik-sdk

Quick Start

const SpikSDK = require('spik-sdk');

// Initialize client
const spik = new SpikSDK('sk-spik-YOUR_API_KEY');

async function run() {
  // Trigger a conversational call
  const call = await spik.triggerCall({
    phone: '+15550199',
    name: 'Jane Doe',
    representativeId: 'REP_UUID_HERE',
    userPrompt: 'Be friendly and introduce our service.'
  });

  console.log('Call Triggered ID:', call.callId);
}

run().catch(console.error);

Environment Variables

You can set the SPIK_API_URL environment variable to override the default API endpoint (useful for development):

export SPIK_API_URL="http://localhost:8000"

API Reference

Initializing Client
const spik = new SpikSDK(apiKey, [baseUrl]);
Account & Usage
  • spik.getProfile(): Returns company profile and limits.
  • spik.getUsage(): Returns minute balance statistics.
AI Representatives
  • spik.createRepresentative(data): Creates a representative configuration.
  • spik.listRepresentatives(): Lists all configured representatives.
  • spik.deleteRepresentative(id): Archives a representative.
Calling & Campaigns
  • spik.triggerCall(options): Initiates a single outbound conversational call.
  • spik.createContactList(name, [description]): Creates a reusable contact list.
  • spik.addContactsToList(listId, contacts): Adds contact array [{ name, phone }] to list.
  • spik.launchCampaign(options): Calls a contact list sequentially using a representative.
Monitoring & Telemetry
  • spik.getCallDetails(callId): Retrieves duration, cost, status, and transcripts.
  • spik.getCallActionLogs(callId): Retrieves execution logs of dynamic API actions.
  • spik.getRecentCalls(): Lists recent call sessions.

License

MIT