Zum Inhalt springen

Web widget & text mode

Diese Seite ist noch nicht auf Deutsch verfügbar. Sie sehen die englische Fassung.

A web agent runs one of your flows over a browser connection instead of a phone call. Web agents are in beta; find them under Web Agent in the project sidebar (in Simple mode, under Channels).

On the Web Agent page, click Create web agent and choose how to deploy it:

  • Widget — a drop-in floating voice button you paste onto any page with a single script tag.
  • API — call the session endpoint directly and build your own voice experience.

Then give it a Name, pick the Flow it runs (the flow’s active version is used), and add its Allowed origins — the domains it may be used from, for example your-company.com. Requests from any other origin are rejected.

Web agents authenticate with a publishable key (nrn_pk_...) from the API keys section of the same page. One key works for every web agent in the project. Publishable keys are safe to put in a web page: they only start sessions for your web agents, and only from allowed origins.

Open the web agent and use Add to your website:

  1. Create or copy a publishable key from the API keys section.
  2. Add your website’s origin to this agent’s allowed origins.
  3. Paste the snippet just before your closing </body> tag.

The snippet looks like this (the page fills in your key and web agent id):

<script
src="https://ui.testing.nairon.cloud/web-agent/v1/widget.js"
data-nairon-key="YOUR_PUBLISHABLE_KEY"
data-web-agent-id="YOUR_WEB_AGENT_ID"
async
></script>

In the widget builder you can set its Position (bottom or top; left, center, or right), its Size (Default or Small), and its Title and Subtitle.

An API web agent’s page shows the request that starts a voice session: a POST with your publishable key (as a bearer token or x-api-key header) from an allowed origin, returning a session token and server address your client connects with. A missing or revoked key returns 401; an origin that isn’t allowed, a disabled agent, or a disabled voice channel returns 403.

To start sessions from your own backend with a secret key instead, use the Service API’s POST /v1/web-sessions.

Besides full voice (WEB_FULL), a session can be text-only (WEB_TEXT): a chat-style conversation with no audio. Text-only sessions are a feature of the Growth plan and higher. They are set up through the Service API — create a web agent with the chat scope (POST /v1/projects/{projectId}/web-sessions/agents) and start sessions with "mode": "WEB_TEXT" (see Web Sessions); the widget itself is voice-only.

A text-only session shows up in your call history and usage with its real duration, but counts zero billed minutes. Voice sessions are billed like a phone call, by duration, at your plan’s normal rate.