> For the complete documentation index, see [llms.txt](https://edentech.gitbook.io/glover/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edentech.gitbook.io/glover/flutter-app/api-security.md).

# API Security

This project uses the `envied` package to manage the API key.

The API key is stored in a local `.env` file, then converted into a generated Dart file before the app is run or built. The app uses that generated value and automatically adds it to every Dio request as:

```http
X-API-Key: your_api_key_here
```

This means you only need to set the API key once, generate the env file, and then run or build the app normally.

{% content-ref url="/pages/sd4jjfeIu1VBw28SAUhs" %}
[API Security](/glover/backend/features/api-security.md)
{% endcontent-ref %}

### 1. Create the .env File

Copy the sample env file:

```
cp .env.example .env
```

Open the new .env file and set your API key:

```
API_KEY=your_api_key_here
```

> Do not commit the .env file. It is ignored by Git.

### 2. Generate the Envied File

After setting or changing the API key, run:

```
flutter pub run build_runner clean
flutter pub run build_runner build --delete-conflicting-outputs
```

This generates the required Dart file used by the app.

### 3. Run or Build the App

Once the generated file is created, you can run the app normally:


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://edentech.gitbook.io/glover/flutter-app/api-security.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.
