Environment Variable Lost When Accessing API Documentation

Piyush Patel
When navigating from my site to the API documentation, the attached environment variable is lost. Specifically, when I click on the "Try Out" button within the documentation, the environment variable is not populated, resulting in no value being displayed in the environment section.
This issue may hinder the functionality of testing API endpoints, as the expected environment variable values are not retained, impacting the overall user experience.
Activity Feed
Sort by

Md Mamunur Rashid
Hi Piyush, good day, we tried to reproduce this issue but it seems like it works fine on our end. Please check once again and if it is convenient for you, please share some screenshots.
In the meantime, you can also have a look into the help doc for configuring environment variables (https://docs.apidog.com/overview-577823m0) and also make sure you have selected the environment on the share doc setting page.

Piyush Patel
Hello Md Mamunur Rashid,
To assist in the investigation, I am sharing a video demonstrating the problem and a link to reproduce it.
https://drive.google.com/file/d/1EOHf5_T6D9LXkpnSPlH5Uwkoia93Dy50/view?usp=sharing
The link to reproduce the issue.
https://docs.aladia.io/?environment[apikey]=$2a$12$XS7ky59n/K5o9THf68zUuOFWexhMrddxKuScQ3MI1azVQHhVl5sEW
Suggestion: Use incognito mode
Looking forward to your response.
Piyush

Piyush Patel
Md Mamunur Rashid
The screenshots of the environment.

Piyush Patel
Md Mamunur Rashid
I am encountering an issue with the environment variable not working as expected, as described in the following documentation: Embedding Values in Document URLs. Could you please take a look and assist with resolving the problem?
https://docs.apidog.com/embedding-values-in-document-urls-715178m0

Karan Alexander
Piyush Patel Thank you for reporting this issue and providing the relevant documentation link. Currently, the environment variable injection, as described in the documentation, only takes direct effect when applied to URLs of the "endpoint" type.
For example, you'll observe the expected behavior with a URL structured like this: https://docs.aladia.io/list-all-comments-14361765e0?environment[apikey]=$2a$12$XS7ky59n/K5o9THf68zUuOFWexhMrddxKuScQ3MI1azVQHhVl5sEW.
We appreciate your feedback on this behavior. I've discussed this with the product team, and we're exploring a potential enhancement. Ideally, we'd like to implement a mechanism where, upon a user accessing a URL with the embedded environment variable, the value is cached within the user's browser for the current environment. This would eliminate the need for your documentation users to access the specific URL each time. We will keep you updated on the progress of this potential improvement.

Piyush Patel
Thank you very much, Karan Alexander!
It seems we're on the same page. Given that this is blocking our release to production, I would like to emphasize the urgency of addressing this issue as a priority. Your prompt attention to this matter would be greatly appreciated.

Karan Alexander
Piyush Patel The fix was released. Could you try it out on your end and confirm the fix?

Piyush Patel
Karan Alexander I’ve checked it out, and it looks like the issue persists when switching between endpoints — the value still gets lost. It seems the fix hasn't resolved the problem on this end either. attach video for the same.
https://www.dropbox.com/scl/fi/32suc08znmxkt326bpusc/Screencast-from-03-28-2025-05-23-35-PM.webm?rlkey=0sm81kvzzs8uu8lg93vxdvrw9&dl=0

Karan Alexander
Piyush Patel Could you try again by refreshing the page? I just clear some middleware cache that might affect the result. I had confirm it on my end too.

Piyush Patel
Karan Alexander Thank you for clearing the middleware cache. I have refreshed the page, and everything appears to be working as expected. I appreciate your assistance in resolving this matter. I will reach out if I encounter any further issues.