Skip to main content
The JavaScript files served by a Neuron expose three Reports methods. They resolve the report target, build concentrator requests, and, for execution, assemble asynchronous progress into a result object. For a shared credential integration, use the backend quickstart. The browser helpers keep the Agent API session in browser storage; use them only where an individual user’s browser session is appropriate. Do not embed your shared client account’s password or JWT in a public page.

Endpoints used by the browser helpers

The helpers send requests to https://<NEURON_HOST>. These are the endpoints you should see in the browser’s network inspector: ExecuteReport() manages registration and result assembly. Its event registration uses this JSON body, with the actual tab ID supplied by Events.js:
The helper makes this request for you. Loading the scripts alone does not establish an authenticated session or prove that progress is arriving. An accepted execution request followed by a completed result confirms the full flow. Use the HTTP execution guide for backend polling with PopMessages; matching browser handlers divert progress from that queue.

Load the Neuron libraries

Read the JavaScript source served by the lab Neuron:
  • Agent.js — HTTP requests, authentication, and session handling.
  • Agent.Things.js — concentrator queries, parameter submission, and asynchronous result assembly.
  • Agent.Reports.js — the GetReports, GetReportParameters, and ExecuteReport methods.
These links provide reference implementations from lab.tagroot.io. For your application, use the files served by your provider’s Neuron so they match its build. In a browser integration, load these files from the same Neuron build:
After the scripts load, set the host and sign in with credentials entered by the individual user:
userName and password are runtime inputs from your sign-in form. Clear the password input after login. The helper generates the nonce and signature, calls /Agent/Account/Login, and stores the returned session JWT for subsequent calls. The NEURON metadata tells Events.js where to receive events when your page uses another origin. Your provider must allow your application’s origin for Agent API and Events access. Use a browser referrer policy that sends the application origin so Agent API requests include the required Referer header. An HTTPS page needs HTTPS scripts/API requests and WSS Events; Events.js selects ws:// when the page itself uses HTTP. Events.js is needed for the execution helper to receive progress and settle its promise. Discovery and parameter retrieval do not require asynchronous events.

List report IDs

Returns a string array containing visible executable leaf report IDs. It filters out nodes without a parent, nodes without commands, and nodes with children. It does not return report contents or execute a report.
The current helper expects the underlying node list to be an array. If the server returns a single node object, the helper can return an empty list. The backend discovery sample normalizes both shapes.

Fetch a parameter form

Use a report ID from discovery:
Returns the form from Stanza.x, or [] when no x element is returned. Check for a valid form before execution. Normalize a single field object to an array when using the current execution helper. See parameter forms.

Submit values and await completion

Each ExecuteReport call starts report execution. For dashboards, use a shared backend job and cached results rather than calling it on every page load. See dashboard refresh policies. This example continues with the fetched form and an illustrative Month parameter:
Replace the field name and value with those defined by your report. Preserve hidden fields and defaults unless you intend to change them. Treat report messages as part of result validation as well; the helper’s HasErrors does not classify every message level.
The current helper serializes one nested string value per field (field.value.value). Use strings such as "0" and "false", not JavaScript numbers or booleans. Multi-value fields require the HTTP submit form, which can contain repeated <value> elements.
The promise resolves after queryDone or queryAborted; an abort can resolve with HasErrors: true instead of rejecting. Transport or command errors can reject the promise. Add an application deadline because missing events can leave it pending. A local deadline does not cancel execution on the server. See assembled results for the returned fields.

Method signatures

The last three arguments are optional device, service, and user tokens for deployments that require them. They are separate from the JWT used to authenticate HTTP requests. Leave them omitted unless your provider supplies them. You can resolve a bare target once with AgentAPI.Things.XmppHelper.GetFullJid(jid, false) and use the full JID for subsequent calls. Resolve it again if the target reconnects. The helpers otherwise probe bare JIDs when needed. When the user signs out, call await AgentAPI.Account.Logout() to end the session.