Skip to main content
Solved

How can I make it so that both the development and production API keys are added to the Ampli file on ampli pull?

  • September 29, 2022
  • 3 replies
  • 358 views

Forum|alt.badge.img

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?

 

Best answer by shreyas

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. 

View original
Did this topic help you find an answer to your question?

3 replies

  • New Member
  • 2 replies
  • Answer
  • October 3, 2022

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. 


Forum|alt.badge.img
  • Author
  • Conversationalist
  • 5 replies
  • October 3, 2022

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


  • New Member
  • 2 replies
  • October 3, 2022

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings