This was surprisingly annoying to figure out.
I used this Google API documentation for vanilla JS, but it was a lot more trouble than I expected to get it working in a TypeScript React project.
Long story short, you need to install:
- gapi-script
- @types/gapi
- types/gapi.auth2
For some architectural reason it seems the gapi npm package can't just be import
ed into the .tsx file.
This doesn't work.
node-modules is not committed on github, so it will only work on my machine. And if you have setup github actions, it wont compile for the same reason - the package is only locally updated.
Do you know of any other workaround ?