I'm implementing trigger v3 on my nuxt 3 app deployed on cloudflare pages.
CF pages environment variables aren't provided through process.env, so I need to perform manual setup from what I understood
But my issue is that calling configure() does nothing. It works perfectly fine locally, in dev mode, but when I deploy in cloudflare & run the following code :
configure({
accessToken: useRuntimeConfig().trigger.accessToken,
})
await tasks.batchTrigger<typeof assessmentResultTask>(
'assessment-result',
fullAssessments.map(a => ({ payload: { assessmentId: a.id } })),
)
I get the following error :
You need to set the TRIGGER_SECRET_KEY environment variable. See https://trigger.dev/docs/management/overview#authentication
(I previously ran the configure() in a middleware before the actual endpoint handler calling batchTrigger runs, but since it wasn't working I moved it right above the batchTrigger call, but I still can't get it to work
I have the latest vers. installed of the package : "@trigger.dev/sdk": "3.3.7"
I even tried to set the access token in the env context, still getting the same error :
process.env.TRIGGER_ACCESS_TOKEN = useRuntimeConfig().trigger.accessToken
process.env.TRIGGER_SECRET_KEY = useRuntimeConfig().trigger.accessToken