documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[Bug]: All instances of the STRAPI_ADMIN_* environment variables will not work on Strapi Cloud

Open derrickmehaffy opened this issue 5 months ago β€’ 3 comments

Link to the documentation page or resource

Multiple

Describe the bug

In serveral parts of our documentation we reference the STRAPI_ADMIN_* environment variables. These variables are taken into account at build time which will not work on Strapi Cloud due to some upstream provider restrictions

Additional context

Related to internal TID2550

Suggested improvements or fixes

We need to add a warning that these variables will not work on Strapi Cloud and only apply on self-hosted applications

Related issue(s)/PR(s)

No response

derrickmehaffy avatar Aug 07 '25 14:08 derrickmehaffy

πŸ€– I've analyzed your question and here's what I found:

Hi there! Thank you so much for taking the time to report this issue and for your attention to detail regarding the use of STRAPI_ADMIN_* environment variables in Strapi Cloud. We really appreciate your effort to help improve the documentation and the experience for everyone in the Strapi community.

You are absolutely correct: environment variables prefixed with STRAPI_ADMIN_* are designed to be injected at build time, which means they work as expected in self-hosted Strapi deployments. However, due to the way Strapi Cloud handles builds and environment variable injection (and certain upstream provider restrictions), these variables are not available at runtime in Strapi Cloud environments. As a result, any configuration or customization relying on STRAPI_ADMIN_* variables will not function as intended on Strapi Cloud.

Current Documentation Reference:
The documentation does mention that prefixing an environment variable with STRAPI_ADMIN_ exposes it to the admin front end (e.g., STRAPI_ADMIN_MY_PLUGIN_VARIABLE is accessible through process.env.STRAPI_ADMIN_MY_PLUGIN_VARIABLE), but it does not currently warn users about the Strapi Cloud limitation. This is a great catch on your part! See documentation

Suggested Improvement:
We agree that adding a clear warning to the documentation is necessary to prevent confusion. The warning should state that STRAPI_ADMIN_* environment variables are only supported in self-hosted Strapi deployments and are not available in Strapi Cloud due to build-time injection limitations.

Workarounds & Next Steps:

  • For Strapi Cloud users who need to pass custom values to the admin panel, we recommend exploring alternative approaches, such as hardcoding values in your codebase or using other supported configuration methods.
  • If you have a specific use case that requires dynamic admin panel configuration on Strapi Cloud, please consider sharing your needs on our feedback portal so we can better understand and prioritize this feature.
  • For further questions or community support, feel free to join our Discord or check out the Strapi Cloud documentation.

I've flagged this for the documentation team, and if this is determined to be a core product issue, it may need to be transferred to the main Strapi repository for further review. If you feel this is a bug in the product rather than just a documentation gap, please let us know and we can tag @pwizla for further triage.

Thanks again for your valuable feedback and for helping make Strapi better for everyone! πŸš€

πŸ“š Relevant documentation:


ℹ️ This response was generated automatically. If this doesn't fully answer your question or if you need further assistance, please mention @pwizla in a comment and a human maintainer will help you.

You can also try our interactive AI chat for more detailed assistance.

πŸ’‘ For feature requests or product feedback, visit feedback.strapi.io.

github-actions[bot] avatar Aug 07 '25 14:08 github-actions[bot]

@derrickmehaffy , the bot suggesting you to contact community support/Discord was priceless πŸ˜† Thanks for the ping. I'll look into it soonβ€”or, as usual, if you'd like to open a quick PR to fix this, feel free to do so 😊

pwizla avatar Aug 07 '25 16:08 pwizla

Yeah will do, in a crunch today but I may have some time tomorrow. Just wanted to get this open so I don't forget

derrickmehaffy avatar Aug 07 '25 16:08 derrickmehaffy