-
Notifications
You must be signed in to change notification settings - Fork 0
Widget Guide
dev-mondoshawan edited this page Apr 16, 2026
·
2 revisions
**Referenced Files in This Document**
- [backend/src/routes/widget.js](https://github.com/RunTimeAdmin/AgentID/blob/main/backend/src/routes/widget.js)
- [backend/src/services/badgeBuilder.js](https://github.com/RunTimeAdmin/AgentID/blob/main/backend/src/services/badgeBuilder.js)
- [frontend/src/widget/Widget.jsx](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/src/widget/Widget.jsx)
- [frontend/src/widget/widget-entry.jsx](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/src/widget/widget-entry.jsx)
- [frontend/src/widget/widget.css](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/src/widget/widget.css)
- [frontend/src/components/TrustBadge.jsx](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/src/components/TrustBadge.jsx)
- Introduction
- Widget Types
- Embedding the Widget
- Widget Configuration
- Customization
- API Integration
- Examples
AgentID provides embeddable trust widgets that can be integrated into any website. These widgets display real-time trust scores, verification status, and agent metadata in a visually appealing format.
A complete, self-contained HTML page served via iframe:
<iframe
src="https://agentid.provenanceai.network/widget/{pubkey}"
width="400"
height="300"
frameborder="0">
</iframe>Features:
- Auto-refresh every 60 seconds
- Responsive design
- Status-based theming
- Capability tags
A static SVG image for documentation and README files:
Features:
- Scalable vector graphics
- Status colors (green/amber/red)
- Score visualization
- Compact size
Raw badge data for custom implementations:
const response = await fetch('https://agentid.provenanceai.network/badge/{pubkey}');
const badge = await response.json();<div class="agentid-widget">
<iframe
src="https://agentid.provenanceai.network/widget/AGENT_PUBKEY_HERE"
width="100%"
height="320"
style="border: none; border-radius: 12px;"
title="AgentID Trust Widget">
</iframe>
</div><div class="widget-container" style="position: relative; padding-bottom: 80%; height: 0;">
<iframe
src="https://agentid.provenanceai.network/widget/AGENT_PUBKEY_HERE"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;"
title="AgentID Trust Widget">
</iframe>
</div>function embedAgentIDWidget(containerId, pubkey) {
const container = document.getElementById(containerId);
const iframe = document.createElement('iframe');
iframe.src = `https://agentid.provenanceai.network/widget/${pubkey}`;
iframe.width = '100%';
iframe.height = '320';
iframe.style.border = 'none';
iframe.style.borderRadius = '12px';
container.appendChild(iframe);
}
// Usage
embedAgentIDWidget('widget-container', 'agent_pubkey_here');The widget supports these display modes:
| Option | Description | Default |
|---|---|---|
theme |
Color theme (dark/light) | dark |
compact |
Compact mode (true/false) | false |
Pass options via query parameters:
<iframe src="https://agentid.provenanceai.network/widget/{pubkey}?theme=light&compact=true">The widget automatically refreshes every 60 seconds to keep data current. This can be disabled:
<iframe src="https://agentid.provenanceai.network/widget/{pubkey}?refresh=false">When embedding via iframe, you can style the container:
.agentid-widget-container {
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.agentid-widget-container iframe {
display: block;
}Build your own widget using the JSON API:
async function renderCustomWidget(elementId, pubkey) {
const response = await fetch(`https://agentid.provenanceai.network/badge/${pubkey}`);
const data = await response.json();
const widget = document.getElementById(elementId);
widget.innerHTML = `
<div class="trust-badge ${data.status}">
<h3>${data.name}</h3>
<div class="score">${data.score}/100</div>
<div class="status">${data.label}</div>
<div class="capabilities">
${data.capabilities.map(c => `<span>${c}</span>`).join('')}
</div>
</div>
`;
}GET /badge/{pubkey}Response:
{
"pubkey": "agent_public_key",
"name": "Agent Name",
"status": "verified",
"score": 85,
"label": "HIGH",
"capabilities": ["trading", "analytics"],
"registeredAt": "2024-01-15T10:30:00Z",
"totalActions": 150,
"widgetUrl": "https://agentid.provenanceai.network/widget/agent_pubkey"
}GET /badge/{pubkey}/svgReturns an SVG image with status-based theming.
GET /widget/{pubkey}Returns a complete HTML page with the widget.
import React, { useEffect, useState } from 'react';
function AgentIDWidget({ pubkey }) {
const [badge, setBadge] = useState(null);
useEffect(() => {
fetch(`https://agentid.provenanceai.network/badge/${pubkey}`)
.then(r => r.json())
.then(setBadge);
}, [pubkey]);
if (!badge) return <div>Loading...</div>;
return (
<div className={`trust-badge ${badge.status}`}>
<h3>{badge.name}</h3>
<div className="score">{badge.score}/100</div>
<div className="label">{badge.label}</div>
</div>
);
}## Trust Verification
This agent is verified by AgentID:
[](https://agentid.provenanceai.network/agents/PUBKEY)<table style="border: 1px solid #ddd; border-radius: 8px;">
<tr>
<td>
<img src="https://agentid.provenanceai.network/badge/PUBKEY/svg"
alt="Trust Badge" width="200">
</td>
</tr>
</table>