# Config

Configuration settings are stored within a JSON object located inside the `/config` folder. You can add multiple config files here for each development environment that you're using.

Gravity ships with `default` and `production` config files to get you started.

Using this approach will automatically load the correct configuration file depending on your environment. For example, you can load your test Stripe settings in your local development environment and your live settings when running in production.

{% hint style="info" %}
Use a filename that matches your `NODE_ENV` name to load that config file in that environment.
{% endhint %}

### Importing The Config Files

To access the key-value pairs in the config file within your code, you first need to import the config file.&#x20;

First, import the `config` package and then `get` the specific object you want from the config file.

```javascript
const config = require('config');
const settings = config.get('stripe');
```

This will import the Stripe settings from the config file loaded in your current environment.

{% hint style="danger" %}
You should store sensitive items like passwords and secrets inside an [environment variable](/gravity-server/environment-variables.md) instead of the config file.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-server/config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
