Next.js Discord

Discord Forum

Unable to pass environment variables in vercel.json cronjob

Unanswered
Masai Lion posted this in #help-forum
Open in Discord
Masai LionOP
I am trying to call an api with a vercel cronjob, the API requires a key that is saved in environment variables .env . I need a help on how I can access the environment variables while in verce.json

{
  "crons": [
    {
      "path": "/api/my-api?authorization=${KEY_IN_ENV}",
      "schedule": "0 7 * * 4"
    }
  ]
}

2 Replies