Skip to content

Commit 87acabe

Browse files
committed
add source-settings include, update accordingly
1 parent eb6360d commit 87acabe

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!-- usually placed under a heading called "Settings and Secrets" -->
2+
3+
Settings allow you to pass configurable variables to your function, which is the best way to pass sensitive information such as security tokens. For example, you might use `settings` as placeholders to use information such as an API endpoint and API key. This way, you can use the same code with different settings for different purposes. When you deploy a function in your workspace, you are prompted to fill out these settings to configure the function.
4+
5+
First, add a setting in **Settings** tab in the code editor:
6+
7+
![A screenshot of the functions settings tab](/docs/connections/functions/images/settings-tab-empty.png){:width="500"}
8+
9+
Click **Add Setting** to add your new setting.
10+
11+
![A screenshot of the "Add Setting" section of the functions settings tab, with apiKey settings included](/docs/connections/functions/images/add-source-setting-dialog.png)
12+
13+
You can configure the details about this setting, which change how it's displayed to anyone using your function:
14+
15+
- **Label** - Name of the setting, which users see when configuring the function.
16+
- **Name** - Auto-generated name of the setting to use in function's source code.
17+
- **Type** - Type of the setting's value.
18+
- **Description** - Optional description, which appears below the setting name.
19+
- **Required** - Enable this to ensure that the setting cannot be saved without a value.
20+
- **Encrypted** - Enable to encrypt the value of this setting. Use this setting for sensitive data, like API keys.
21+
22+
As you change the values, a preview to the right updates to show how your setting will look and work.
23+
24+
Click **Add Setting** to save the new setting.
25+
26+
Once you save a setting, it appears in the **Settings** tab for the function. You can edit or delete settings from this tab.
27+
28+
![A screenshot of the functions settings tab, showing the apiKey setting](/docs/connections/functions/images/settings-tab-non-empty.png){:width="500"}
Loading
Loading

src/connections/functions/source-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ The handler for Source functions is `onRequest()`.
276276

277277
## Create settings and secrets
278278

279-
{% include content/functions/settings.md %}
279+
{% include content/functions/source-settings.md %}
280280

281281
Next, fill out this setting's value in **Test** tab, so that you can run the function and check the setting values being passed.
282282

0 commit comments

Comments
 (0)