Is it possible to create a QR code with Firebase?
I'd like to create a QR code for sharing pdf files with other people. It seems the Firebase has such functions but I couldn't figure it out where to generate the code...
Firebase integrates Google Cloud Functions and Cloud Storage. A straightforward way to generate a QR code could be writing a cloud function that takes the input of your call from Firebase, writes the QR code image to your Firebase connected cloud storage, and then returns the URI of the image.
Firebase Cloud Functions "provides a way to extend the behavior of Firebase and integrate Firebase features through the addition of server-side code."source
So, unlike GCP Cloud Functions that can be written in multiple languages, you typically will write Typescript or Javascript only on Firebase Functions.
node.js// index.js -> bundle.js
var QRCode = require('qrcode')
var canvas = document.getElementById('canvas')
QRCode.toCanvas(canvas, 'sample text', function (error) {
if (error) console.error(error)
console.log('success!');
})
npm QR Code Generator Package
Firebase Functions Getting Started Guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With