JavaScript SDK
The official JavaScript SDK for DialStack lets you embed voice capabilities directly into your application with ready-to-use components for call logs, voicemails, and more.
Distribution Targets
The SDK is available in three distribution formats:
| Target | Import | Use Case |
|---|---|---|
| Main | @dialstack/sdk | React applications with full component support |
| Pure | @dialstack/sdk/pure | Vanilla JavaScript / Web Components only |
| Server | @dialstack/sdk/server | Node.js backend for session creation and API calls |
Installation
npm install @dialstack/sdk
Quick Example
import { initialize, DialstackComponentsProvider, CallLogs } from '@dialstack/sdk';
const dialstack = initialize({
publishableKey: 'pk_live_YOUR_KEY',
});
function App() {
return (
<DialstackComponentsProvider dialstack={dialstack} clientSecret={clientSecret}>
<CallLogs />
</DialstackComponentsProvider>
);
}
What's Included
Embedded Components
- CallHistory - Display recent call history in a compact format
- CallLogs - Display call history with filtering, pagination, and formatting
- Voicemails - List voicemails with audio playback and transcription
Server SDK
- Accounts - Create and manage customer accounts
- Users - Manage users within accounts
- Sessions - Create secure session tokens for embedded components
Next Steps
- Installation - Detailed installation instructions
- Authentication - Learn about session-based authentication
- React Components - Get started with React
- Web Components - Use with vanilla JavaScript
- Server SDK - Backend API integration