Skip to content

QR codes

The QR code endpoint generates QR code images from any text string. QR codes are commonly used for two-factor authentication, sharing links, encoding data, and enabling quick access to information.

Generate QR code

Generate a QR code image from a text string. The QR code can be scanned by any standard QR code reader.

Parameters

The getQR method accepts the following parameters:

ParameterTypeDescription
text
string
The text string to encode in the QR code. Can be a URL, authentication URI, or any text data.
size
integer
The size of the QR code in pixels. Accepts values between 0-1000. Defaults to 200 if not provided.
margin
integer
The margin around the QR code in pixels. Accepts values between 0-10. Defaults to 1 if not provided.
download
boolean
Whether to download the image or return a URL. Defaults to false.

Two-factor authentication

QR codes are commonly used for two-factor authentication (2FA). When setting up TOTP authentication, you can generate a QR code from the authenticator URI.

Customization

Adjust the size and margin of QR codes to match your design requirements. Larger sizes improve scanability, while appropriate margins ensure the QR code is properly recognized by scanners.

Use cases

QR codes are commonly used for:

  • Two-factor authentication: Generate QR codes for TOTP authenticator setup
  • Team invitations: Create QR codes for team invite links to enable quick member onboarding
  • Link sharing: Create QR codes for URLs to enable quick access
  • Event tickets: Generate QR codes for event registration and check-in
  • Wi-Fi credentials: Encode Wi-Fi network information for easy connection
  • Contact information: Share vCard data encoded in QR codes