Files
infisical/docs/integrations/frameworks/gatsby.mdx
2022-11-28 22:34:31 -05:00

42 lines
942 B
Plaintext

---
title: "Gatsby"
---
Prerequisite: [Install the CLI](/cli/overview)
## Initialize Infisical for your [Gatsby](https://www.gatsbyjs.com) app
```bash
# move to your app
cd /path/to/project
# initialize infisical
infisical init
```
## Modify the start script in your `package.json`
```json
...
"scripts": {
"develop": "infisical run -- gatsby develop",
"start": "infisical run -- gatsby develop",
"build": "infisical run -- gatsby build",
"serve": "infisical run -- gatsby serve",
"clean": "infisical run -- gatsby clean"
}
...
```
## Start your development server with environment variables injected
```bash
npm run develop
```
<Note>
Note that for environment variables to be exposed to the client, you'll have
to prefix them with `GATSBY_`. Read more about that
[here](https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/#accessing-environment-variables-in-the-browser).
</Note>