Secure, embeddable widgets with publishable keys
Sipfront offers three types of embeddable widgets:
<!-- Sipfront Widget (works for Test, Project, or Monitor) -->
<iframe
src="https://app.sipfront.com/widget?token=YOUR_TOKEN&bot_id=YOUR_BOT_ID&label=Custom+Label&color=667eea"
width="400"
height="500"
frameborder="0"
style="border: none; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);"
></iframe>
<!--
The token determines the widget type (test/project/monitor).
For test/project: Set bot_id to your bot's unique identifier (required)
For monitor: bot_id can be any value or omitted (not used)
Adjust height to 400px for monitor widgets for optimal display
-->
Widget tokens are publishable keys designed specifically for client-side embedding. Unlike API keys, they are safe to expose in public HTML because:
| Parameter | Widget Type | Required | Description | Example |
|---|---|---|---|---|
token |
All | Yes | Publishable widget token (includes scope and type) | pk_widget_abc123xyz |
bot_id |
Test, Project | Yes | Unique identifier for your bot instance being tested | bot_12345 |
bot_id |
Monitor | No | Any value (not used by monitor widgets) | monitor or status |
label |
All | No | Test/Project: Button text. Monitor: Display name | Test+My+Bot or Service+Status |
show_report |
Test, Project | No | Show "View Full Report" button after test completes | true / false |
color |
All | No | Brand color (6-digit hex, no # prefix) | 667eea |
The widget implements enterprise-grade security with publishable keys:
import React from 'react';
const SipfrontWidget = ({
token, // Your widget token (pk_widget_...) - determines type
botId, // 'monitor' for monitor widgets, or your bot ID for test/project
label = 'Test My Bot',
color = '4f46e5',
showReport = true,
height = 500 // Use 400 for monitor widgets
}) => {
const widgetUrl = new URL('https://app.sipfront.com/widget');
widgetUrl.searchParams.set('token', token);
widgetUrl.searchParams.set('bot_id', botId);
widgetUrl.searchParams.set('label', label);
widgetUrl.searchParams.set('color', color);
widgetUrl.searchParams.set('show_report', showReport);
return (
<iframe
src={widgetUrl.toString()}
width="400"
height={height}
frameBorder="0"
style={{
border: 'none',
borderRadius: '12px',
boxShadow: '0 4px 12px rgba(0,0,0,0.1)'
}}
title="Sipfront Widget"
/>
);
};
export default SipfrontWidget;
Usage:
Test: <SipfrontWidget token="pk_widget_xxx" botId="my_bot" />
Monitor: <SipfrontWidget token="pk_widget_yyy" botId="status" height={400} /> (bot_id can be any value)
<template>
<iframe
:src="widgetUrl"
:width="400"
:height="height"
frameborder="0"
style="border: none; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);"
></iframe>
</template>
<script>
export default {
props: {
token: { type: String, required: true }, // Widget token (determines type)
botId: { type: String, required: true }, // 'monitor' or your bot ID
label: { type: String, default: 'Test My Bot' },
color: { type: String, default: '4f46e5' },
showReport: { type: Boolean, default: true },
height: { type: Number, default: 500 } // Use 400 for monitors
},
computed: {
widgetUrl() {
const url = new URL('https://app.sipfront.com/widget');
url.searchParams.set('token', this.token);
url.searchParams.set('bot_id', this.botId);
url.searchParams.set('label', this.label);
url.searchParams.set('color', this.color);
url.searchParams.set('show_report', this.showReport);
return url.toString();
}
}
};
</script>
Usage:
Test: <SipfrontWidget token="pk_widget_xxx" botId="my_bot" />
Monitor: <SipfrontWidget token="pk_widget_yyy" botId="status" :height="400" /> (bot_id can be any value)