TypeScript API / @laikacms/server/oauth2 / generateQRCodeDataURI
Function: generateQRCodeDataURI()
ts
function generateQRCodeDataURI(text, options?): string;Generates a data URI for a QR code SVG that can be used directly in img src attributes.
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | The text to encode in the QR code |
options | QRCodeSVGOptions | Optional configuration for the QR code generation |
Returns
string
A data URI string (data:image/svg+xml;base64,...)
Example
typescript
const dataUri = generateQRCodeDataURI('https://example.com');
// Use in HTML: <img src="${dataUri}" alt="QR Code" />