Host Config on Github Pages
Use the tools you already know, with version control and automatic signing
Our suggested host for your config file is Github Pages. It has many benefits:
Familiar tools: Git and Github
Version control built-in
Access controls built-in
Branch protections to authorize who can deploy
Setup Repository
Create a repository to host your config file.
We suggest new dedicated repository used only for this and this guide section assumes that approach. Add your JSON config file as a file named config.json
in the root. See detailed instructions below if needed.
Add Custom Domain (optional)
Adding a custom domain will allow you to change to a different host at a later time, if you no longer want to use GitHub Pages as your host.
Setup Automatic Deployment
Github Actions can automatically sign and deploy your config file for you, each time you merge a change. This has the added benefit of checking for errors, and aborting the deployment if any issues are found.
Once your follow the detailed instructions above, check that the action was successful in Github's Actions UI.
Github Settings: Action Based Pages Build
In the github.com UI, open the repo's settings, then open the "Pages" tab. Set the "Source" to "Github Actions" as seen below

Don't skip this step, or builds may not work!
Confirm the Config is Online
Double check everything worked and your signed config file is accessible from the public internet!
Your signed config should now be online at your URL such as:
If you setup custom DNS:
https://democonfig.criticalmoments.io/cmConfig.json
Or via direct Github URL:
https://criticalmoments.github.io/sample_app_config/cmConfig.json
Fetch it using the tool of your choice (curl,
browser).
Use your New Hosted Config
You can use this URL for your app release in your app delegate like so:
// Add this before `CriticalMoments.sharedInstance().start()`
CriticalMoments.sharedInstance().setReleaseConfigUrl("YOUR_URL")
After setting the URL, you can test everything works in-app by running your app with a "Release" build configuration in it's Xcode scheme:

Setup Access Control and Branch Protections (optional, recommended)
Setup any access controls and branch protections you desire.
Since the Critical Moments config file can push messaging to your users in app, we suggest you require approvals before merging into the deployment branch (defaults to main branch), just as you would a any webpage.
Last updated
Was this helpful?