Guide
Embed the NextX softphone in your software
Agents take and place calls right inside your software, without another NextX tab. One script tag, no server needed.
1Allow your domain
developers.nextx.vn › My apps › Settings › Embedded softphone → add your software's domain (e.g.
https://crm.your-company.com). Pages not listed cannot embed the softphone.2Paste the script tag
The softphone appears in a corner. The first time, the agent clicks Sign in to NextX in a popup. Your page only receives call events — never tokens or extension credentials. Add
data-nextx-callto phone numbers for click-to-dial.HTML<script src="https://developers.nextx.vn/phone/v1/phone.js"></script> <script> const phone = NextXPhone.init({ clientId: "<APP_ID>" }); // lang, workspaceId, position, appUrl phone.on("incoming", (c) => openCustomer(c.from)); // screen-pop phone.on("ended", (c) => saveCallLog(c.callId, c.status, c.talkSec)); </script> <!-- click-to-dial: any element with data-nextx-call --> <a href="#" data-nextx-call="0901234567" data-nextx-contact-ref="CUS-00123">0901 234 567</a>3Or use the npm package
Same code as the script build, with TypeScript types. Events:
ready,auth-required,status,incoming,answered,ended,error.npmnpm i @nextxai/sdk import { NextXPhone } from "@nextxai/sdk/phone"; const phone = NextXPhone.init({ clientId: process.env.NEXT_PUBLIC_NEXTX_APP_ID! }); phone.call("0901234567", { contactRef: "CUS-00123" }); phone.on("answered", ({ callId }) => markInProgress(callId)); // phone.hangup() · phone.logout() · phone.destroy()4Try it
Add
https://developers.nextx.vnto the allowed domains and open the test page. For server-side call history, also subscribe tocall.*webhooks.