Skip to content

Commit

Permalink
Improve docs on Using Custom Config Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu authored Jul 24, 2024
1 parent c4b8993 commit b50a185
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Guide/config.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,18 @@ If you are ok to commit your secrets to git repo, you can also put the env vars
You can now access the `StripePublicKey` parameter by calling `getAppConfig @Config.StripePublicKey`:

```haskell
import qualified Config

action MyAction = do
let (StripePublicKey stripePublicKey) = getAppConfig @Config.StripePublicKey

putStrLn ("Stripe public key: " <> stripePublicKey)
```

If you want to fetch it in a helper function, we need to define the `?context`:

```haskell
getStripePublicKey :: (?context :: ControllerContext) => StripePublicKey
getStripePublicKey = getAppConfig @Config.StripePublicKey
```

## Environment Variables

Expand Down

0 comments on commit b50a185

Please sign in to comment.