Strapi Cloud doesn't read environment variable in Stripe Payments plugin

I am using the Stripe Payments plugin (from Strapi Marketplace) and within admin, in Settings > Payments Configuration, a request is made to /strapi-stripe/getSettings to load the values from the Strapi database.

Likewise, to save them by clicking the Save button, another request is made to /strapi-stripe/updateSetting.

According to the plugin documentation, you have to create a token called STRAPI_ADMIN_API_TOKEN in Settings > Global Settings > API Tokens, save its value as an environment variable and do the corresponding npm run build or yarn build.

While everything works perfectly locally, when I deploy the application to Strapi Cloud, the request returns a 403. After a lot of research, I have discovered where the problem is but not the solution, because I think it is no longer up to me.

The value “Bearer undefined” appears in the Authorization header of the request. By doing a multitude of tests, I have verified that this behavior is due to this file:


In it there is a line where the environment variable is consulted:

const apiToken = process.env.STRAPI_ADMIN_API_TOKEN;

Which is later used to build the request using axios to /strapi-stripe/getSettings. Such reading of process.env.STRAPI_ADMIN_API_TOKEN returns undefined.

I have created the environment variable in the deploy configuration in Strapi Cloud several times, I have deployed several times, I have tried countless things, including trying to inject the environment variable into the plugin through webpack, as they say here:

Finally, I have tried to deploy the project on Heroku and it actually works perfectly as well, therefore it is a problem with the Strapi Cloud environment.

However, I would like Strapi to give me a solution since otherwise I will be forced not to deploy to their infrastructure, since I need that plugin and I have no other alternatives.

Also, I suspect this could happen with other plugins so it doesn’t seem like a minor problem to me.

EDIT: I asked for Strapi official technical support and they answered to me that is a known bug from their side and they are working on it, without confirmed date.

Was this ever resolved? I’m facing a similar issue with the Paypal plugin. Getting 500 error, and it seems connected to the node module reading ‘undefined’ from stapi API token.