Embeddable Widget
Add VectoSolve to your website with a single HTML tag. The widget is a Web Component with Shadow DOM, zero dependencies, and full customization.
Installation
Add the script and component to your HTML:
<script src="https://vectosolve.com/widget.js"></script> <vectosolve-uploader api-key="vs_xxx" theme="light" accent-color="#0090ff" language="en" />
Attributes
| Attribute | Default | Description |
|---|---|---|
| api-key | (required) | Your VectoSolve API key (vs_xxx) |
| theme | "light" | "light" or "dark" |
| accent-color | "#0090ff" | Primary button/accent color (hex) |
| language | "en" | UI language: "en", "fr", "es", "de", "pt", "it" |
| max-size | 10485760 | Max file size in bytes (default 10MB) |
| tools | "vectorize" | Comma-separated: "vectorize,remove-bg,upscale" |
| batch | "false" | "true" enables multi-file upload with zip download |
| compact | "false" | "true" for a smaller layout |
| show-branding | "true" | "false" hides the Powered by VectoSolve footer |
| border-radius | "16" | Container border radius in px |
| font-family | system fonts | Custom font family for the widget |
JavaScript Events
Listen for custom events on the widget element:
const widget = document.querySelector('vectosolve-uploader');
widget.addEventListener('vs:convert', (e) => {
console.log('SVG ready:', e.detail.svgContent);
console.log('SVG URL:', e.detail.svgUrl);
// Per-file review verdict — automate on it: green flows straight
// through, amber/red gets a human look before production.
const q = e.detail.sourceQuality;
if (q && q.review_recommended) {
flagForReview(e.detail.svgUrl, q.note);
}
});
widget.addEventListener('vs:download', (e) => {
console.log('User downloaded:', e.detail.tool);
});
widget.addEventListener('vs:error', (e) => {
console.error('Error:', e.detail.message);
});| Event | Detail | Description |
|---|---|---|
| vs:convert | { svgUrl, svgContent, resultUrl, tool, sourceQuality } | Fired when conversion completes |
| vs:download | { tool } / { batch, count } | Fired when user downloads the SVG |
| vs:error | { message, tool } | Fired on conversion error |
Widget States
idleconvertingdoneerror
The widget transitions through these states automatically. The UI updates to show drag-drop, progress spinner, download button, or error message.
Shadow DOM
The widget uses Shadow DOM for style isolation. Your page's CSS won't affect the widget, and the widget won't affect your page. Use the accent-color and theme attributes for customization.