1.0.5 • Published 5 months ago

magic-pintercall v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Magic Pintercall

A simple wrapper for integrating Pintercall voice calls into your application.

Installation

npm install magic-pintercall

Usage

import { PintercallSession } from 'magic-pintercall';

// Create a new session
const pintercall = new PintercallSession();

// Start a call
const startCall = async () => {
  const result = await pintercall.startCall('your-assistant-id', {
    systemPrompt: 'Optional system prompt',
    voice: 'Optional voice selection',
    tools: [] // Optional tools configuration
  });

  if (result.success) {
    console.log('Call started successfully!');
  } else {
    console.error('Failed to start call:', result.error);
  }
};

// End a call
const endCall = async () => {
  const result = await pintercall.endCall();
  
  if (result.success) {
    console.log('Call ended successfully!');
  } else {
    console.error('Failed to end call:', result.error);
  }
};

// Check if a call is active
const isActive = pintercall.isCallActive();

API Reference

PintercallSession

Constructor

new PintercallSession(config?: { apiBaseUrl?: string })

Methods

startCall
startCall(assistantId: string, config?: {
  systemPrompt?: string;
  voice?: string;
  tools?: any[];
}): Promise<StartCallResponse>
endCall
endCall(): Promise<EndCallResponse>
isCallActive
isCallActive(): boolean

License

MIT

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago