I try to use the Cloud Vision API in a Firebase Cloud function to OCR an image stored in Firebase Storage.
I import the Google Cloud vision client library as follow
const vision = require('@google-cloud/vision');
and then I call
vision.detectText({ source: { imageUri: 'gs://xxxx.appspot.com/yyyy.JPG' } })
However I get an error
TypeError: vision.detectText is not a function
Initially I used
vision.textDetection({ source: { imageUri: ... } })
from this example https://cloud.google.com/vision/docs/reference/libraries#client-libraries-install-nodejs but I got the exact same error. I then read that textDetection has been replaced by detectText but no more success
Thanks in advance