Hi, I have just seen the new blog post on Worker sites, so I decided to give it a try, I generated a full-permission API key, and wrangler config’d it, the API key works using the curl command.
I then generated a worker site project using wrangler generate, and then added my account ID to the wrangler.toml
However, when I try to wrangler preview --watch it says Error: [ApiError { code: 10000, message: “Authentication error”, other: {} }]
Oh and yes, I saw the other post with this error, and everyone is saying to log out and log back in. That didn’t work - that issue seemed to be displayed on the Cloudflare dashboard whereas I am seeing it in the CLI
I just decided to set up my first Wrangler Site, and ran into this same error. I disagree with the previous comments; the whole point of API Keys was to prevent handing out the Global API Key to all the developers / machines.
The API Key I created has the following permissions:
Workers KV Storage:Edit, Workers Scripts:Edit
I added it to my system with wrangler config which asked for the email and the API Key, it did not refer to it as the Global API Key.
I also tried adding
Zone.Zone Settings, Zone.Workers Routes
But no joy. Has anyone had success using API Keys with wrangler and CLI and workers?