How to use Google Vision in a Firebase cloud function
You can easily use Google Vision in a Firebase cloud function by using Rowy's low-code UI for Firebase. Start with ready-to-use code blocks for cloud functions and tweak them in any way you like in JS/TS with a built-in code editor. Deploy in one click to your own Firebase project on Google Cloud. No DevOps, CLIs, or configs to deal with.
Give it a quick spin by following these steps.
Step 1: Setup Rowy
Connect Rowy to one of your existing Firebase projects or create a new one from scratch.
If you are new to creating a project on Rowy here is how to Get Started
Step 2: Connect to your Google Vision account
If you have an API secret key then you can store this in your project's secret manager on the Google Cloud Platform. You can use any NPM module or API using fetch.
Step 3: Add Google Vision with our ready-to-use code blocks
3a: Click Add Column and name it. Next, select the Field Type to be an image. Now you have your first column set!
3b: Make another column with the field type as a derivative. This is where Rowy makes data easy. Simply select the Listener Field to be the column containing your image and the Outfield Type to be text.
3c: The Derivative Script is where the magic happens. Row has automatically created the function header and parameters for you to use.
Implement Google Vision by assisgning it to a variable and creating a client to fetch - await - and return the desired text. It should look something like this:
Step 4: Add more data fields
Want more? Simply create more columns and within Rowy's ready-to-use code blocks point to the data field you want.
4a: Make a derivative column that listens to your previously made Google Vision column. Select the output field type to JSON and again edit Rowy's code blocks to your liking.
Try something like this where you can pull out the currency symbol, date and total cost:
Step 5: That's it!
You can deploy your project as a cloud function to Firebase in just one click. No DevOps, CLIs, terminal, configs to deal with. Focus just on building the logic of your cloud functions.
For more documentation check out our Rowy Docs