mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
35 lines
577 B
Plaintext
35 lines
577 B
Plaintext
---
|
|
title: "React"
|
|
---
|
|
|
|
Prerequisite: [Install the CLI](/cli/overview)
|
|
|
|
## Initialize Infisical for your [Create React App](https://create-react-app.dev)
|
|
|
|
```bash
|
|
# move to your React app
|
|
cd /path/to/project
|
|
|
|
# initialize infisical
|
|
infisical init
|
|
```
|
|
|
|
## Modify the start script in your `package.json`
|
|
|
|
```json
|
|
...
|
|
"scripts": {
|
|
"start": "infisical run -- react-scripts start",
|
|
"build": "react-scripts build",
|
|
"test": "react-scripts test",
|
|
"eject": "react-scripts eject"
|
|
}
|
|
...
|
|
```
|
|
|
|
## Start your server with environment variables injected
|
|
|
|
```bash
|
|
npm start
|
|
```
|