I deployed my firebase genkit flow to google cloud function. I have set httpOptions: {cors: true} as well as cors: ‘*’ and even listed out all the allowable sites but I am still running into CORS error when triggering my function.
I even tried to setGlobalOptions for cloud functions.
setGlobalOptions({
region: "us-central1",
});
defineSecret("GOOGLE_GENAI_API_KEY");
configureGenkit({
plugins: [
firebase(),
vertexAI(),
dotprompt(),
],
logLevel: "debug",
enableTracingAndMetrics: true,
});
export const carePlanGenerationFlow = onFlow(
{
name: "carePlanGenerationFlow",
inputSchema: z.object({
content: z.string(),
sourceUrl: z.string(),
}),
outputSchema: z.any(),
httpsOptions: {
// tried setting cors: '*'
// and also ['http://127.0.0.1:7001','https://xyx.com/, 'https://us-central-xyz.cloudfunctions.net']
// but nothing works
cors: true,
},
Spent several hours looking at examples, reading docs and tried a bunch of solutions mentioned above but nothing is working.