Skip to content

Commit 7af9a84

Browse files
committed
add private env value info.
1 parent a092364 commit 7af9a84

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

docs/testing-deployment-publishing/development-environments/development-environments.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: Development Environments
44
description: Learn how to create and leverage development environments in FlutterFlow.
55
tags: [Dev Environments, Backend, Testing]
66
sidebar_position: 2
7+
toc_max_heading_level: 4
78
keywords: [Dev, Development, Environments, FlutterFlow, Backend]
89
---
910

@@ -57,11 +58,12 @@ You can create and switch environments in the **Dev Environments** page in **App
5758
The selected environment is used to generate the proper app code when you run, test, deploy or export your app. The only things that change between environment are the [Firebase Project](#configuring-firebase-or-supabase-for-each-environment) or variables that are tied to [Environment Values](#use-environment-values)
5859

5960

60-
### Use Environment Values
61+
### Environment Values
6162
Environment Values can be used to dynamically change parts of your app's code based on the environment that is being used.
6263

6364
For example, in an e-commerce app, you might define an `apiUrl` Environment Value that points to different API URLs for Development, Staging, and Production. This allows you to test new features without affecting the live production environment, where real customer orders are processed.
6465

66+
#### Use Environment Value
6567
Let's see an example of creating and using `apiUrl`:
6668

6769
<div style={{
@@ -90,16 +92,32 @@ Let's see an example of creating and using `apiUrl`:
9092
</div>
9193
<p></p>
9294

93-
:::info
94-
After switching to an environment, FlutterFlow generates code specific to that environment, for any of the following interactions:
95+
:::tip[Generated Code]
96+
When you switch to an environment, FlutterFlow generates code specific to that environment, for any of the following interactions:
9597
- Test / Run mode sessions
9698
- Local Run
9799
- Code export
98100
- Deployment
99101

100-
You also may see different project errors depending on which environment you have selected.
102+
You may also encounter different project errors depending on the selected environment.
103+
104+
In the generated code, FlutterFlow creates two files:
105+
106+
- `environment.json` – Stores the environment values defined by the user in FlutterFlow.
107+
- `FFDevEnvironmentValues` class – A singleton class that holds a single instance of the `FFDevEnvironmentValues` object. It includes initialization logic and getters for accessing these environment values. They can also be referenced in your custom code resources. See **[Common Custom Code Examples](../../ff-concepts/adding-customization/common-examples.md)**.
101108
:::
102109

110+
#### Private Environment Values
111+
112+
You can mark environment values as private when they contain sensitive information that should not be exposed in the client-side code. **Private** environment values are not included in the generated code.
113+
114+
Currently, the only way to use a private environment value is as a variable in a private API call. Since private API calls are routed through a Cloud Function, the variable value remains hidden from any client-side requests made by the app.
115+
116+
:::tip[Generated Code]
117+
For private environment values, the generated code does not include these values in the `environment.json` file, and no getter logic is created in the `FFDevEnvironmentValues` class.
118+
:::
119+
120+
103121
### Configuring Firebase or Supabase for each Environment
104122
A single FlutterFlow project can have **multiple environments**, each mapped to its **own Firebase or Supabase project**. This ensures that environments like `Development``Staging`, and `Production` remain independent, giving you better control over your app's data and behavior throughout different stages of development.
105123

@@ -159,6 +177,8 @@ It's recommended that you keep schemas consistent between the different Supabase
159177

160178

161179

180+
181+
162182
### FAQ
163183

164184
<details>

0 commit comments

Comments
 (0)