@lob/qr-code
v1.0.31
Published
Node wrapper for the lob QR Code Gen
Downloads
1,527
Readme
@lob/qr-code
Lob QR Codes for Node.js
Usage Example
import { QRCode } from '@lob/qr-code';
const qrcodeCreator = new QRCode({
api_key: '<LOB API KEY>',
logger: new LobLogger(),
env: 'production',
});
const qrcode = await qrcodeCreator.create(
/* request body */
{
redirect_link: '<destination url when scanning the QR>',
size: 1,
slug: '<url-slug>',
logo: { url: '<logo-url>' }, // optional
style: { color: { background: '#ffffff', foreground: '#000000' } }, // optional
domain: '<shortlink vanity domain -- e.g. lob.stb>', // optional
}, /* params */ {
account_id: '<account_id>',
resource_id: '<resource_id>',
object_type: '<object type>',
mode: '<test or live>'
});
// get a base64 encoded data url of the image in the desired format
qrCode.toDataUrl('image/png');