diff --git a/utils/visionUtils.ts b/utils/visionUtils.ts index 53acf24..2ff87c9 100644 --- a/utils/visionUtils.ts +++ b/utils/visionUtils.ts @@ -2,8 +2,8 @@ import vision from '@google-cloud/vision'; import path from 'path'; const client = new vision.ImageAnnotatorClient({ - keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS - ? path.resolve(process.cwd(), process.env.GOOGLE_APPLICATION_CREDENTIALS) + credentials: process.env.GOOGLE_APPLICATION_CREDENTIALS + ? JSON.parse(process.env.GOOGLE_APPLICATION_CREDENTIALS) : undefined, });