Generate QR codes from any website — no framework needed
Add the script and call OpenQTR.generate():
<script src="https://cdn.jsdelivr.net/npm/@satirr/openqtr/dist/sdk.js"></script>
<div id="qr"></div>
<script>
OpenQTR.generate({
text: "https://example.com",
element: "#qr",
size: 250,
});
</script>CDN (recommended):
<script src="https://cdn.jsdelivr.net/npm/@satirr/openqtr/dist/sdk.js"></script>
Self-host: Use /openqtr-sdk.js if running the OpenQTR app locally.
| Option | Type | Default | Description |
|---|---|---|---|
| text | string | — | Data to encode (required) |
| element | string | HTMLElement | — | CSS selector or element ref (required) |
| size | number | 200 | QR code size in px |
| format | "png" | "svg" | "png" | Output format |
| fgColor | string | "#000000" | Foreground color |
| bgColor | string | "#ffffff" | Background color |
| errorCorrectionLevel | string | "M" | L | M | Q | H |
SVG with custom colors:
OpenQTR.generate({
text: "Hello World",
element: "#qr",
size: 400,
format: "svg",
fgColor: "#e94560",
bgColor: "transparent",
errorCorrectionLevel: "H",
});For the full API reference, error handling details, rendering internals, browser support, and build-from-source instructions, open the comprehensive markdown guide:
Read the full expert guide (GUIDE-API.md)