googlemaps / googlemaps/js-api-loader

Dynamic Api Keys

Open
#871 4 comments 0 reactions 0 assignees View on GitHub
type: question wontfix
Dominant language
TypeScript
Stars
449
Forks
74
Avg merge
1m
Merged PRs (30d)
21

Description

Hello,

I'm using an app with multiple domains, and I would like to switch between different apiKeys depending on which domain is being used to access the app. However, once I instantiate the component with a particular apiKey, if I then access the app via another domain, I encounter the following error: "Error: Loader must not be called again with different options."

I've tried instantiating it in different components and even in separate routes within the same application to ensure different Loaders are created, but I still encounter the same error.

My question is: once a Loader is instantiated with an apiKey, is it possible to dynamically change it? Or is there any recommended approach to handle multiple apiKeys?

Thank you in advance for your help!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.