Hi,
I am building a page in Power pages site for making payment using Stripe and it is working fine. Now What the problem is I have mentioned the Keys for triggering the Stripe REST APIs explicitly in the HTML Code so anyone who view the page source can see those secret keys. Is there any way to hide this. And regarding this can we use Environment variable concept ? If we can, How to use environment variables in Power pages.
I have used Site Settings as my environment variables but how can I swap the values when importing from Dev to UAT and from UAT to Prod?
Like with regular Power Platform environment variables, I can use configuration file (https://learn.microsoft.com/en-us/power-platform/guidance/alm-accelerator/setup-data-deployment-configuration). Is there such thing for Site Setting when doing deployment?
@Anonymous you can also look into Azure Functions for securing the integration:Payments in PowerApps Portal — part 1/2 | by Andrew Grischenko | Microsoft Power Platform Tips & Tricks | Medium
@Anonymous you can also look into Azure Functions for securing the integration:Payments in PowerApps Portal — part 1/2 | by Andrew Grischenko | Microsoft Power Platform Tips & Tricks | Medium
@bssienes Yes, We can still read values inside variables from the page source.
I created the Payment Intent by leveraging Power Automate and getting the client secret in JS variable. With the help of the client secret I am making payment in JS. So I am not exposing the Stripe API Key here in JS.
@Anonymous I am building something similar. Is it safe to retrieve the StripeAPiKey into a Javascript variable? I believe we can still read values inside variables from the page source.
{% assign StripeApiKey = settings['settingName'] %} then use {{ StripeApiKey }} in your JavaScript.
Or simply use {{ settings['settingName'] }}
I am able to use the site setting by following the below syntax,
I have created the site setting. Now how I refer this in my Html or JS code?
The equivalent to Environment Variable in Power Pages are Site Settings: Configure site settings for portals - Power Apps | Microsoft Learn
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43