Custom Apps for CTI Panel
The CTI panel lets agents use your CTI (computer telephony integration) widget inside Yellow.ai, next to the Inbox, without switching tabs. This guide is for CTI vendors and bot admins who register that widget.
How the CTI panel works
- The agent opens the panel from a phone button near the bottom of the left navigation sidebar. The button shows your app's name, or a tooltip with it when the sidebar is collapsed.
- The panel floats over the page. Agents can drag it by its header and resize it from the bottom-right corner. Its position and size are saved in the agent's browser.
- Your widget is loaded once when the agent opens the bot, even before the panel is opened, and stays loaded while the agent moves between pages (for example Inbox and Overview).
- Minimize only hides the panel. The widget keeps running, so a call in progress is not dropped.
- Reloading the browser tab or switching to another bot reloads the widget.
- Each bot shows one CTI app. If more than one is registered and enabled, only the first one is used.
Before you start
- The CTI panel is enabled per bot by Yellow.ai. Ask your Yellow.ai contact to enable it for every bot you will use, including sandbox or staging bots. Until it is enabled, the bot shows no phone button even if the app is registered.
- The widget must be served over HTTPS.
- Registering the app needs a user with the bot's admin or developer role.
- Only users with the Inbox agent or Inbox admin role on the bot see the phone button. Other users, for example builders, do not load the widget.
Step 1: Allow Yellow.ai to embed your widget
Your widget is loaded in an iframe inside a Yellow.ai page (https://cloud.yellow.ai), which is itself shown inside the platform (https://nexus.yellow.ai). Browsers check every page in that chain, so the widget's responses must allow both origins:
Content-Security-Policy: frame-ancestors https://nexus.yellow.ai https://cloud.yellow.ai
- Do not send
X-Frame-Options: DENYorSAMEORIGIN. It cannot list other sites and blocks the embed. - If the widget relies on cookies inside the iframe, set them with
SameSite=None; Secure. Otherwise the browser treats them as blocked third-party cookies.
If the panel shows "refused to connect" or stays blank, this header is the first thing to check.
Step 2: Widgets on a local network
If the widget is hosted on a private network, for example on a *.local host name or a private IP address, Chrome and Edge apply Local Network Access rules: a public site such as Yellow.ai needs the agent's permission to load it [1].
- Yellow.ai delegates this permission to your widget's iframe, so nothing is needed in your code.
- The first time, the browser asks the agent to allow the site to access devices on the local network. The agent must click Allow.
- To skip the prompt for all agents, the customer's IT team can allow
https://nexus.yellow.aiandhttps://cloud.yellow.aiin theLocalNetworkAccessAllowedForUrlsbrowser policy [2].
Widgets on a public HTTPS address do not need this step.
Step 3: Register the widget
Register the widget with the custom-app-config API, the same API used for other custom apps, and set location to inbox.cti.panel.
curl --location 'https://cloud.yellow.ai/api/agents/settings/custom-app-config?bot=${botId}' \
--header 'Cookie: ym_xid=${ymXid}' \
--header 'Content-Type: application/json' \
--data '{
"name": "Phone",
"description": "CTI widget for calls",
"url": "https://cti.example.com/widget",
"iconUrl": "https://cti.example.com/logo.png",
"defaultContext": [],
"trigger": "live-forever",
"enabled": true,
"type": "ephemeral",
"location": "inbox.cti.panel"
}'
botIdis the bot ID, shown in the Yellow.ai URL after/bot/.- Use your bot's region host if the bot is not on
cloud.yellow.ai. See Bot region. - This API takes a signed-in user's session, not an API key. To get
ym_xid, sign in to Yellow.ai as a user with the bot's admin or developer role, open the browser's developer tools, go to Application > Cookies, select the Yellow.ai host and copy the value ofym_xid. It stops working when that user signs out.
What matters for the CTI panel:
locationmust beinbox.cti.panel.nameis shown on the sidebar button and in the panel header.urlis the HTTPS address of your widget.- The panel ignores
iconUrl,defaultContext,triggerandtype, but the API still requires them. Use the values above.
For every field, the response, and how to update or delete the app, see Custom App Configuration.
Step 4: Get the signed-in agent
Your widget can ask Yellow.ai which agent is signed in, for example to log the agent in to your telephony system. Send the YApps ask_agent_info event to the parent window. Yellow.ai answers with the agent's email, user ID and name.
With the YApps SDK
<script type="module">
import { YAppWidget } from "https://cdn.yellowmessenger.com/yapps-sdk/v1.0.0/widget.js";
const yApp = new YAppWidget();
const response = await yApp.ask("ask_agent_info");
const { email, userId, name } = response.eventResponse.eventData;
</script>
With postMessage
const requestId = `req_${Date.now()}`;
window.addEventListener("message", (event) => {
if (event.origin !== "https://cloud.yellow.ai") return;
const { requestId: id, eventResponse } = event.data || {};
if (id !== requestId || !eventResponse) return;
const { email, userId, name } = eventResponse.eventData;
// Use the agent's details here.
});
window.parent.postMessage(
{ eventKey: "ask_agent_info", eventType: "ask", requestId, eventData: {} },
"*"
);
Response
{
"eventKey": "ask_agent_info",
"eventType": "ask",
"requestId": "req_1762761600000",
"eventData": {},
"eventResponse": {
"status": "success",
"eventData": {
"userId": "<Yellow.ai user ID>",
"name": "Agent name"
}
}
}
| Field | Description |
|---|---|
email | The signed-in agent's email address. |
userId | The agent's Yellow.ai user ID, the same ID used for ticket assignment. |
name | The agent's display name. |
- Messages are only relayed from the origin of the
urlyou registered. If your widget redirects to another host, Yellow.ai cannot read its messages. - The SDK promise does not time out. Add your own timeout if the widget may also run outside the CTI panel, where nothing answers.
- Ask again after the widget reloads. The answer always describes the agent who is signed in now.
Step 5: Test
Test on a sandbox or staging bot before production.
- Ask Yellow.ai to enable the CTI panel for the bot.
- Register the widget as in Step 3, then sign in as a user with the Inbox agent role and reload Yellow.ai.
- Check that the phone button with your app's name appears near the bottom of the left sidebar and opens the panel.
- Check that the widget loads inside the panel and
ask_agent_inforeturns the signed-in agent. - Start a call, move to another page and minimize the panel. Reopen it and check that the call is still there.
| Problem | Likely cause |
|---|---|
| No phone button | The CTI panel is not enabled for this bot, the app is missing, disabled or has a different location, or the signed-in user has no Inbox agent or Inbox admin role. |
| Panel is blank or "refused to connect" | frame-ancestors does not allow both Yellow.ai origins, or X-Frame-Options is set. |
Widget on *.local does not load | The agent blocked local network access, or the browser policy is missing. |
ask_agent_info never answers | The widget page is on a different origin from the registered url, or it runs outside the CTI panel. |
References
- Chrome: Local Network Access - https://developer.chrome.com/blog/local-network-access
- Chrome Enterprise policy
LocalNetworkAccessAllowedForUrls- https://chromeenterprise.google/policies/#LocalNetworkAccessAllowedForUrls - MDN:
frame-ancestors- https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/frame-ancestors