- Developers
- Dialer SDK
- Integration guide
Integrate the Trellus Dialer SDK
Choose the setup for your own Trellus team or for the customer teams your product serves. Both use the same browser dialer.
Add calling for your existing team
Use this setup when the callers already belong to one Trellus workspace. A rep can select a contact in your app and make one call, or select a finite batch and run it in power or parallel mode.
- Install the browser SDK and audio dependency. Use the mock quickstart to wire your first calling screen.
- Confirm the workspace and rep are approved for live SDK calling, the calling mode is enabled and a caller number is available. Contact Trellus support with the workspace and the modes you need.
- For the published browser SDK, each rep supplies their own personal API key from Trellus Settings → Call Data API when available. Your app verifies the rep’s identity before supplying the credential through
getApiKey.
A single team setup uses your existing users and seats. Your app’s signed-in session determines whose calls and transcripts it can display.
Offer calling to customer teams
Use this setup when your product embeds Trellus for customers with separate seats, callers and call data. Establish one approved Trellus workspace for each customer before enabling live calling.
- Agree on which customer workspaces Trellus will enable, who can manage members, and how each rep is identified.
- Use the approved team management integration from your server. Verify the customer’s team and rep’s membership before provisioning a user, enabling an eligible seat or delivering a personal credential.
- Bind the authenticated customer and rep to their confirmed Trellus team and user IDs. Keep team administrator credentials on the server. The dialer authenticates as the individual rep.
- Store an operation ID for each membership or seat change. Read the existing result before retrying an uncertain change. Coordinate transfers and offboarding with Trellus.
To request the partner onboarding specification, talk to Trellus about the Dialer SDK. The npm dialer is common to both setups. Team management is a separate server integration.
Run a one-off call or batch
npm install @trellusrelease/dialer-sdk @twilio/voice-sdk
Create one dialer owner per rep. Your app selects eligible contacts, assigns each task a unique ID and passes one E.164 number per task. A manual action calls one contact. A power run dials the batch one at a time, and a parallel run can ring two or more eligible contacts at once.
import { createBrowserDialer } from '@trellusrelease/dialer-sdk/browser';
// These callbacks belong to your app. Bind them to the current signed-in rep.
const dialer = await createBrowserDialer({
getApiKey: getCurrentRepTrellusKey,
maxLines: 2, // Set only after confirming the rep has parallel access.
onDisposition: saveCallOutcome,
});
const stopRendering = dialer.subscribe(renderCallState, { emitCurrent: true });
const stopTranscripts = dialer.on('transcript.updated', ({ sessionId, segments }) => {
replaceTranscript(sessionId, segments);
});
// Bind connectAudio to a user click so the browser can request microphone access.
const connectAudio = () => dialer.connect();
// Call after audio is ready, from the corresponding action in your app.
const callOne = task => dialer.dial(task);
const startPower = async tasks => {
dialer.setTasks(tasks);
await dialer.start({ mode: 'power' });
};
const startParallel = async tasks => {
dialer.setTasks(tasks);
await dialer.start({ mode: 'parallel', lines: 2 });
};
// On view unmount, call stopRendering() and stopTranscripts().
// On app sign-out, first drain or resolve active calls, then await dialer.destroy().
Implement the key, render, transcript and save callbacks in your app. Keep the personal key in memory and out of URLs, logs and bundles. To use ready-made controls, mount the optional dialer and session viewer against the same instance.
Use the SDK attempt ID for controls and the confirmed session ID for transcripts and correlation. Review event delivery and transcript updates before connecting a durable call history.
Hosted workspace preview
Use the 0.1.1 preview to test the browser message API for the hosted dialer. The package includes a sandbox that simulates manual, power, and parallel calls across two browser origins. It uses simulated transcripts.
npm install --save-exact https://www.trellus.ai/downloads/dialer-sdk/0.1.1/trellusrelease-dialer-sdk-0.1.1.tgz https://www.trellus.ai/downloads/dialer-sdk/0.1.1/trellusrelease-dialer-ui-0.1.1.tgz
node node_modules/@trellusrelease/dialer-sdk/examples/hosted-embed/server.mjs
Open 127.0.0.1:4177 in your browser. The installed SDK contains the message protocol and examples under node_modules/@trellusrelease/dialer-sdk/.
The hosted pilot uses an approved app origin and the rep’s Trellus session. Contact Trellus for the hosted pilot URL and workspace setup before testing live calling, coaching, or Salesfloor access.
Test before you call a contact
- With the mock transport, try a single manual call, a three-contact power queue and a two-line parallel queue. Simulate a connection in the parallel queue and verify the other ringing attempt ends.
- Simulate transcript corrections and confirm your app replaces the displayed segments. Simulate a failed outcome save and confirm wrap-up stays open.
- Verify pause stops new placement, while hangup targets an individual attempt. Keep an unknown attempt visible until its result is resolved. See the call lifecycle.
- For partners, confirm a rep signed into one customer’s workspace cannot retrieve another customer’s credentials or session data.
- Use an approved test destination for the first live call. Verify microphone permission, two-way audio, connection, call end and wrap-up. Test parallel with two approved destinations after the single-line check passes.
Hand this to your implementation agent
Give your agent the guide and the public types from node_modules/@trellusrelease/dialer-sdk. Fill in the rep sign-in flow and the system that saves call outcomes, then use this prompt.
Add the Trellus Dialer SDK 0.1.0 to an existing app. Ask which
workspace model applies: one existing Trellus team or separate approved
customer teams. Use the published SDK TypeScript declarations as the API
contract.
Keep our contacts, permissions, call buttons and outcome storage. Give
the SDK a finite batch of eligible contacts with stable task IDs and
E.164 numbers. Set up the mock transport first and demonstrate manual,
power and a two-line parallel run. Mount the optional UI only if we ask
for ready-made calling controls.
Render snapshots and replace each session's transcript when
transcript.updated arrives. Keep task, attempt and session IDs separate.
Save wrap-up through onDisposition and wait for acknowledgment. Pause
dispatch and reconcile unknown outcomes before resetting or retrying.
For live testing, connect audio from an explicit user action. Provide
the signed-in rep's own API key through getApiKey. Keep admin credentials
on the server. Show what happens when audio permission is blocked, an
outcome save fails or a call stays unknown. Use only approved destinations
after the mock checks pass.