Skip to content

Commit b5a0ee6

Browse files
author
Rudy Weber
committed
update readme
1 parent 813f14d commit b5a0ee6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ config.socket;
106106
config.port;
107107
```
108108

109+
By default, Platform.sh environment variables are prefixed with `PLATFORM_`. In some cases, you might need to change this default in order to have access to environment variables at build time (like with [create-react-app](https://create-react-app.dev/docs/adding-custom-environment-variables/)).
110+
111+
You can do this like so:
112+
```js
113+
const config = require("platformsh-config").config({ varPrefix: "MY_PREFIX_" });
114+
```
115+
109116
### Reading service credentials
110117

111118
[Platform.sh services](https://docs.platform.sh/configuration/services.html) are defined in a `services.yaml` file, and exposed to an application by listing a `relationship` to that service in the application's `.platform.app.yaml` file. User, password, host, etc. information is then exposed to the running application in the `PLATFORM_RELATIONSHIPS` environment variable, which is a base64-encoded JSON string. The following method allows easier access to credential information than decoding the environment variable yourself.

0 commit comments

Comments
 (0)