You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/supabase.md
+15-26Lines changed: 15 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,7 +178,7 @@ Edge Functions are ideal for:
178
178
-**Calling external APIs securely** (e.g., Stripe, Twilio, OpenAI) without exposing keys in the client app
179
179
-**Generating personalized AI content** such as product recommendations, support replies, onboarding guides, weekly usage summaries, or tailored learning suggestions
180
180
-**Running scheduled or on-demand automations**
181
-
-**Performing complex business logic**thatt is not suitable for client-side execution
181
+
-**Performing complex business logic**that is not suitable for client-side execution
182
182
-**Enforcing secure access rules** using Supabase Auth (require logged-in user)
183
183
184
184
:::info
@@ -199,6 +199,9 @@ To create and deploy the Edge Function, follow these steps:
199
199
200
200
1. Open the **Supabase module** from the left sidebar.
201
201
2. Scroll to **Edge Functions** and click **+** to create a new one.
202
+
:::note
203
+
The agent may also determine when parts of your feature implementation should live in the backend and proactively create Edge Function code on your behalf.
204
+
:::
202
205
3. This opens the **Agent Panel** on the right with a prefilled starter prompt. Simply continue describing what you want your function to do. For example:
203
206
204
207
```jsx
@@ -208,35 +211,29 @@ Create a Supabase Edge Function that uses OpenAI api to generate a motivational
The agent will scaffold a complete Edge Function, including folders and `index.ts`. You will now see the function generated under the following structure:
214
+
The agent will create a complete Edge Function using Typescript, including folders and `index.ts`. You will now see the function generated under the following structure:
You can open and edit the function like any other file in Dreamflow.
218
-
219
220
:::
220
221
221
222
#### 2. Add Required Secrets
222
223
223
224
If your Edge Functions require secrets like API keys, Dreamflow automatically detects them from your generated code and allows you to add the required values.
224
225
225
-
To configure your function’s secrets, open the **Supabase > Secrets** section and add the following:
226
-
227
-
-**YOUR_API_KEY**: Enter your own API key.
228
-
-**SUPABASE_URL**: Copy the **API URL** from the **Project Details** section at the top.
229
-
-**SUPABASE_ANON_KEY**: Copy the **Anon Key** from the same **Project Details** section.
226
+
To configure your function’s secrets, open the **Supabase > Secrets** section in Dreamflow and add the values specific to your edge function.
230
227
231
-
Once added, Dreamflow will rewrite the deployment environment so your function can access these secrets at runtime.
228
+
Saving these values in Dreamflow pushes them to your Supabase project.
232
229
233
230

234
231
235
232
#### 3. Deploy the Function
236
233
237
-
After reviewing your function and adding secrets:
234
+
After reviewing your function and adding secrets you are ready to deploy your function.
238
235
239
-
1.Return to**Supabase > Edge Functions** section.
236
+
1.Open the**Supabase > Edge Functions** section.
240
237
2. Click **Deploy Function**.
241
238
3. A confirmation dialog appears; click **Deploy**.
242
239
@@ -245,7 +242,7 @@ After reviewing your function and adding secrets:
245
242
246
243
#### 4. Verify Deployment
247
244
248
-
After deployment, open the **Supabase Dashboard > Edge Functions** page. You should now see your function listed.
245
+
After deployment, you can open the **Supabase Dashboard > Edge Functions** page to ensure your function has been properly deployed.
@@ -256,12 +253,16 @@ Once your Edge Function is deployed, you can trigger it directly from your app.
256
253
257
254
**Using Agent**
258
255
259
-
You can simply ask the Agent to connect the function to the correct part of your UI. For example:
256
+
You can ask the Agent to connect the function to the correct part of your UI. For example:
260
257
261
258
```jsx
262
259
Call the `generate-motivation` Supabase Edge Function on the home page and display the returned message in the motivational message widget.
263
260
```
264
261
262
+
:::note
263
+
The agent should also automatially wire up the function to the correct parts of your app as you build.
264
+
:::
265
+
265
266
The agent will automatically place the call in the appropriate widget, manage loading states, and update your UI.
266
267
267
268
**Add Manually**
@@ -418,18 +419,6 @@ To fix this, use a valid email address during sign-up so you can receive and con
418
419
</p>
419
420
</details>
420
421
421
-
422
-
423
-
<details>
424
-
<summary>
425
-
Are Supabase Edge Functions supported in Dreamflow?
426
-
</summary>
427
-
428
-
<p>
429
-
Currently, **Edge Functions are not supported in Dreamflow**. If you need to create or manage Edge Functions, you’ll have to do so directly from the **Supabase Console**.
430
-
</p>
431
-
</details>
432
-
433
422
<details>
434
423
<summary>
435
424
Why can’t I log in with the email I used to generate sample data?
0 commit comments