Skip to content

Build Secrets

Dan Siegel edited this page Mar 14, 2018 · 1 revision

Modern Apps have a lot of secrets, or at the very least variables that may change based on an environment. Secrets could be something that really is sensitive and should be kept out of Source Control such as an OAuth Client Id, or it could be something such as the URL to use for the Backend which may change between Development, Staging, and Production. The Build Tools allow you to handle these secrets with ease in your application through the use of a JSON file.

{
  "AppBackend": "https://backend.awesomeapp.com",
  "ClientId": "abc123",
  "IsSomethingTrue": true
}

By including a JSON File like the one shown above, the Secrets task will generate a class in your project like:

namespace YourApp.Helpers
{
    internal static class Secrets
    {
        internal const string AppBackend = "https://backend.awesomeapp.com";

        internal const string ClientId = "abc123";

        internal const bool IsSomethingTrue = true;
    }
}
Clone this wiki locally