Skip to main content
An external application can combine ordinary RevoEngine Endpoints with an Assistant conversation. The Asterion portal uses an Endpoint for deterministic price calculations and a Component tools plugin for conversational stock and pricing questions. Both call the same Pricing Library.
Asterion customer portal with contract pricing, current stock and a completed AI sales consultation

A real local portal: the product form and AI Sales Desk return the same 46.25 EUR contract quote. The product drawing is illustrative; prices, stock and tool activity come from the running synthetic instance.

Keep authority on the server

Create a dedicated portal service account and a scoped key. Store it only on the backend. Resolve the buyer from the portal’s authenticated session, authorize access to that buyer, and choose the matching business tools on the server. Never let a browser choose a platform identity, arbitrary plugin, permission level or another customer’s thread ID. The local example represents one fictional buyer and uses two read-only plugin actions. It does not implement multi-customer login, checkout or payment. Adding those requires application authentication and authorization in addition to platform permissions. See authentication and service accounts.

Calculate the form quote through an Endpoint

Expose SalesTools through a POST Endpoint such as /asterion/contract-quote. Send the SKU and quantity through your backend; the Component resolves contract pricing. For the seeded buyer, this input:
produces a quote containing:
Do not send unitPriceMinor or discountBps as buyer-controlled authority. A quote is provisional; reserving inventory is a separate transaction with its own authorization and idempotency key. Endpoint runtime explains request input and response handling.

Start a scoped Assistant stream

The following server-side function forwards an already authenticated portal request to RevoEngine. Its caller must authenticate and authorize the buyer, enforce request-size and rate limits, and restrict CORS/CSRF according to the portal’s session model. The key and attached plugin below are configured for the single demo buyer; substitute a buyer-scoped design before serving multiple customers. Set REVO_API_URL to the API origin, REVO_INSTANCE to the instance ID, REVO_PORTAL_KEY to the service-account key, and REVO_SALES_PLUGIN_ID to the reviewed plugin ID. Keep these values out of frontend builds and logs.
Portal backend · Node.js
The prompt communicates the task. The service account, resource access, attached plugin contract and actual Component implementation provide the authorization boundary. A read-only prompt alone is insufficient.

Render events as they arrive

SSE is a sequence of events, not one JSON response. A chunk can contain half an event, several events or part of a UTF-8 character. Use a streaming decoder and retain incomplete frames. This client calls a same-origin backend route that invokes the function above:
Portal browser · SSE consumer
Render text with textContent or a reviewed Markdown renderer. Do not insert raw model output as HTML. If the stream pauses for a decision, use the supported approval/clarification flow or explain the pending state; do not auto-approve a write to make the portal look successful.

Retain evidence without crossing owners

A thread created by the portal service account belongs to that identity. A regular operator’s conversation link does not automatically grant access to it. The Asterion portal provides a scoped receipt with the completed answer and its business-tool execution identifiers; it does not expose a private diagnostic export. For continuing conversations, map the server-owned thread ID to the authenticated buyer before calling the message-stream operation. Never accept an arbitrary thread ID from a browser and forward it with a more privileged key. Decide separately whether a disconnected request should stop or continue as background work, and design billing, timeout and cancellation around that choice.

Verify the integration

Exercise the same SKU and quantity through the form, portal Assistant and attached-plugin Agent. Compare the returned quote and inspect actual tool executions. Test an invalid SKU, invalid quantity, unauthorized buyer, provider error, disconnect and partial stream. Confirm that the browser’s network traffic and frontend source contain no platform key. In the local example, the form and both AI surfaces returned 46.25 EUR for four units. Changing the form to ten units returned 115.63 EUR. No quote reserved inventory. Continue with business plugins, browser verification and Asterion operations.
Last modified on October 20, 2026