Skip to content

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 ​

ParameterTypeDescription
textstringThe text to encode in the QR code
optionsQRCodeSVGOptionsOptional 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" />

Released under the MIT License.