Skip to main content

My organization has two projects: one development and production. They’re both tracking the same events and we’d like to be able to switch between the two projects as we’re using our application and changing environments. At first I manually added the development API key to the Ampli file, as there was a spot for it already above the production key, but whenever I use ampli pull in the terminal via the Ampli CLI to pull in the latest events, the Ampli file is regenerated and the development key I added is gone. How can I have both API keys pulled in and added to the Ampli file on ampli pull?

 

Hi @michaelhandkins ,

 

Thanks for your question. We do not recommend modifying the generated code, while you are using the Ampli CLI + Ampli SDK.

 

To get this working, we recommend setting up environments in Amplitude-Data in the Environments tab. Once you have set this up, the appropriate API will be automatically included when you do:

ampli pull

 

Hopefully this works for you. 


@shreyas I do not have an Environments tab. Is this only available to those with Admin access?


@michaelhandkins : You might have to ask your admin to then set it up for you via:

Amplitude-Data → Settings page, as shown here:

 

Once configured for your project in Amplitude-Data, you should be able to switch the environment. 


Reply