googleapis / googleapis/google-cloud-node
Add support for non-Node worker environments
- Dominant language
- TypeScript
- Stars
- 3.2k
- Forks
- 712
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 99
Description
### What would you like to see in the library?
Support for non-NodeJS runtimes like Cloudflare workers. Currently this library [fails to compile for Cloudflare](https://github.com/nitrojs/nitro/issues/1821#issuecomment-1923441480) when using Nitro framework. In other workers it could just fail in runtime.
### Describe alternatives you've considered
It works to use this library only for Typescript types and send requests the other way:
```
import type { protos } from '@googlemaps/places'
const data = await $fetch('https://places.googleapis.com/v1/places:autocomplete', {
method: 'POST',
body: {
input,
languageCode: language,
sessionToken,
locationBias: { rectangle: {
low: { latitude: businessArea.minLat, longitude: businessArea.minLng },
high: { latitude: businessArea.maxLat, longitude: businessArea.maxLng },
} },
} as protos.google.maps.places.v1.IAutocompletePlacesRequest,
headers: { 'X-Goog-Api-Key': googleMapsApiKey },
})
```
Contributor guide
Assessment
This issue has not been assessed yet.