Skip to content

Commit ba03714

Browse files
committed
Update Library Values to clarify usage
1 parent 43e49cf commit ba03714

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

docs/ff-concepts/adding-customization/configuration-files.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,19 @@ If `ALLOW_HTTP_TRAFFIC` is set to `true` in FlutterFlow’s Environment Value, t
254254

255255
**Example 3: Using Library Values**
256256

257-
If you are building a [FlutterFlow Library](../../resources/projects/libraries.md) and need to include API keys in native code without exposing them when users import the library, you can use [Library Values](../../resources/projects/libraries.md#library-values) as placeholders. This ensures that when someone installs your library, they can define their own values without seeing the actual key or credentials inside the native files.
257+
If you are building a [FlutterFlow Library](../../resources/projects/libraries.md) and need to include public API keys in native code, you can use [Library Values](../../resources/projects/libraries.md#library-values) as placeholders. This ensures that when someone installs your library, they can define their own values.
258258

259-
For example, if your library requires an API key for a third-party service (e.g., Google Maps or a payment provider), it’s best not to expose the key directly in the manifest file. Instead, create a file-level variable and assign it a Library Value.
259+
For example, if your library integrates with a public weather API that requires an API key (such as Open-Meteo or WeatherAPI for general use), it’s best not to add the key directly in the manifest file. Instead, create a file-level variable and assign it a Library Value.
260260

261-
```
261+
```jsx
262262
<application>
263263
<meta-data
264264
android:name="com.google.android.geo.API_KEY"
265-
android:value="{{MAPS_API_KEY}}" />
265+
android:value="{{WEATHER_API_KEY}}" />
266266
</application>
267267
```
268268

269-
The library user will define their own API key under Library Values when importing your library. At build time, FlutterFlow replaces `{{MAPS_API_KEY}}` with the user-defined key.
269+
The library user will define their own API key under Library Values when importing your library. At build time, FlutterFlow replaces `{{WEATHER_API_KEY}}` with the user-defined key.
270270

271271
## Editable Files
272272

docs/resources/projects/libraries.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,16 @@ The library author selects which pages to include and publishes the library. Whe
295295

296296
## Library Values
297297

298-
**Library values** are essentially variables created and used by a library author and intended to have their values set by the library user. These values allow library author to create configurable variables that are useful in different contexts, such as API keys, global settings, or other project-specific configurations. These values allow library users to input specific data required for the library to function properly in their project.
298+
**Library values** are essentially variables created and used by a library author and intended to have their values set by the library user. These values allow library author to create configurable variables that are useful in different contexts, such as public API keys, global settings, or other project-specific configurations. These values allow library users to input specific data required for the library to function properly in their project.
299299

300-
For example, If someone has built a library that uses OpenAI API, they would define a Library Value for the OpenAI API key. As the user of the library, when you import, you must provide your own API key to ensure the library functions properly.
300+
For example, if someone builds a library with a paginated list or a tabbed interface, they can define Library Values for display settings like `Items per page: 10` or `Initial tab index: 0`. This allows the library user to easily customize the UI behavior to fit their project’s needs without modifying the library’s internal logic.
301+
302+
:::danger
303+
**Library Values should not be used to store private or sensitive data**, such as secret API keys or credentials. These values are not currently designed to securely store or handle sensitive information.
304+
305+
The use of *public API key* is generally acceptable, because the keys often have limited permissions, rate limits, or are intended for public use. For instance, if someone creates a library that connects to a public weather API, they might define a Library Value for the API key. Users of that library can then input their own API key to make it work.
306+
:::
301307

302-
By using Library Values, the library author allows users to adapt the library to their own configurations without hardcoding sensitive or project-specific data, like API keys, into the library itself.
303308

304309
### Create Library Values as Author
305310

0 commit comments

Comments
 (0)