<iframe> and plain JavaScript. Your application supplies verification reports; the viewer displays them through postMessage.
This page covers iframe communication. Your application runs verification and prepares reports in the format below. The viewer validates their structure without independently verifying their evidence.

Example model verification view with Model and Gateway tabs, attestation details, and a Verify again action.
1. Add the iframe
Serve your application over HTTPS. Register the message listener before setting the iframe’ssrc.
2. Connect the viewer
Save this asverification.js. The connection code uses browser APIs and has no SDK or framework dependency.
verification.js
3. Supply your reports
Supply a callback that returnsVerificationReport objects for your model, Gateway, or response, including unsuccessful verification results:
<script type="module">:
disconnect() before removing the iframe or changing the verification target, then reconnect with the callback for the new target. Pending results from the previous connection are ignored.
Report types
Choose the report type for what your application verifies. Both use the shared types below. These declarations describe the payload; the JavaScript connection does not import them.- Model / Gateway
- Response
Use this type for deployment attestation. Both model and Gateway reports use
kind: 'model'; scope distinguishes them. The model field identifies the target model and is required for this report type, including Gateway-only reports.- Successful reports require
attestation, a knownscope, and noerror. Model scope requiresgpuEvidence; Gateway scope requirestlsBindingandstatus: "partial". Only model scope can usestatus: "verified". - Use
failedwhen verification rejects a signature or evidence, andunverifiablewhen it cannot complete. Include a safeerror.message; usescope: "unknown"if verification could not establish the scope.
as VerificationReport does not remove runtime fields. Keep API keys, chat content, raw SDK results, raw exceptions, and deployment configuration out of reports.
For SDK verification, see the JavaScript SDK guide. Convert SDK verification results to this format in your application. For response reports, call verifyResponse() on the original SDK client that made the request, after any response stream is fully consumed.
Customize the viewer
Add these optional parameters to the viewer URL inverification.js:
For example:
https://cloud.near.ai/verify?darkMode=true&showHeader=false&canRequestReports=true.
Troubleshooting
Reference
- JavaScript SDK: create completions and verify responses.
- Verification Center: inspect a model or response in the standalone viewer.
- Verification policy: choose the checks your application requires.