Embed widget
@gigaqr/embed drops a GigaQR creation form onto any page. Visitors create QRs against your workspace; you get a server-side qr.created webhook for every success.
Install
npm install @gigaqr/embedOr load it directly in the browser without a bundler via esm.sh:
<script type="module">
import { GigaQR } from 'https://esm.sh/@gigaqr/embed'
</script>Mount
import { GigaQR } from '@gigaqr/embed'
const widget = GigaQR.mount('#qr-slot', {
publishableKey: 'pk_live_...',
theme: { primary: '#0ea5e9' },
onCreated: (qr) => {
// qr.scanUrl is the short URL your visitors will scan
console.log(qr)
},
})
// later:
widget.unmount()Configuration
publishableKey(required) — starts withpk_live_.host— defaults tohttps://gigaqr.com. Override for self-hosted or local dev.theme—primary+backgroundCSS colors.height/width— number (pixels) or any CSS length.onReady/onCreated/onError— event callbacks.
Origin allowlist
Create a publishable key under Dashboard → Developer, then add each host the widget will render on to Allowed origins (e.g. https://acme.com). Calls from other origins are rejected server-side.
Server confirmation
The widget returns { id, hash, scanUrl } on success, but always trust the qr.created webhook on your workspace as the authoritative event — client callbacks can fail or be spoofed by end users.
Examples
Working examples (vanilla HTML, React + Vite, and a Node script for the REST API) live in the packages/embed-sdk/examples folder of the open-source repo.