Auth API from widget served from local server

I’m really enjoying Grist and trying to make a custom widget that excutes sql via API like this code. https://github.com/paulfitz/grist-widget/blob/master/sql/script.js

Sample repo maybe runing local Grist server on docker and another web server for widget to test in local environment. But I’m trying to access https://docs.getgrist.com/api directly from widget served from local web server. I already knew that docs.getgrist.com blocks access from browser using API key.

Could you tell me how to auth API of docs.getgrist.com from widget served from local web server? If Grist Plugin API grist.docApi.getAccessToken can be mocked well, it will accelerate development. If I have to create an API proxy, I would be happy to receive information on that as well. Sorry if this question is off the mark.

Thanks.

I wrote tiny proxy script with node-http-proxy to add Authorization header. Then, overwrite grist global variable using @rollup/plugin-inject. I have to disable browser security to avoid CORS errors, but I could build test environment I wanted.