Supabase Plugin - Integrate Supabase into your Bubble app

I can’t believe this is actually happening. Been waiting for this so long, It’d be great if in the future we have ways to integrate with AWS or Xano,Wasabi,Firebase.

Hello,

@arc.en
Thank you so much for your enthusiasm!
Could you please share a bit more about what specific integrations or workflows you’re interested in?
For reference, we already offer several plugins for Firebase and Wasabi:

Once we understand your exact use case or what you’re hoping to build, we’ll be able to suggest the best solution or point you in the right direction.

@naveenreddyla
Thank you for confirming that the update seems to have resolved the issue on your end. We appreciate you taking the time to test it out.

If you encounter any new issues or have additional feedback as you continue testing, please let us know. We’re always here to help.

@steven.h.liu.1
This issue almost always points to how the foreign key is set up, the query’s filter, or the relationship between your tables. Please double-check that the user_id values match correctly in both tables and that your join/filter settings are accurate.

A few suggestions that might help:

  • Re-check the foreign key relationship and sample data in both tables.
  • In your plugin config, temporarily try * in the Columns field and see if you get nested results.
  • Confirm if there’s any RLS policy that might restrict the join SELECT results.
  • As a test, try a raw SQL query in the Supabase SQL Editor to see if the join returns results directly.

Let us know what you find!

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

EDIT1

@ZeroqodeSupport i think i have discovered the error.

My table schema is table user_profile connected with sensitive_user_contact via the fk user_id. However, user_id is used as primary for both tables.

When i use the following column select in the plug-in

user_id
creator_name
bubble_id
sensitive_user_contact!user_id (email)

It doesn’t recognize user_id as the foreign key. However, when I created an additional column user_id1 that is not primary and use that as the fk connector between the two tables, it pulled the information successfully, so it does seem to be a problem associated with primary being the fk.

Do you know what I need to change in the column select syntax to make sure its anchoring towards the primary? (as i don’t want to have two columns with the same data)

Alternatively, is this true (even when its a user_table with secretive info and a user_table with non-secretive info)?

:white_check_mark: Best practice schema-wise: It’s actually more standard to give sensitive_user_contact its own id as primary key, and keep user_id as a unique foreign key. That way you avoid this clash and most ORMs/plugins handle it fine.

___________________________________

Hi @ZeroqodeSupport- Here are the results:

Re-check the foreign key relationship and sample data in both tables.

This is connected correctly via user_id

In your plugin config, temporarily try * in the Columns field and see if you get nested results.

This is the setting. Join query still didn’t show.

Confirm if there’s any RLS policy that might restrict the join SELECT results.

I disabled the RLS for both tables and still didn’t work

As a test, try a raw SQL query in the Supabase SQL Editor to see if the join returns results directly.

This pulled successfully via Supabase SQL query. Here is the code used:

-- Comprehensive join between user_profile and sensitive_user_contact
SELECT 
    up.user_id,
    up.creator_name,
    up.ig_handle,
    up.tiktok_handle,
    up.country,
    suc.email,
    suc.phone,
    suc.preferred_contact,
    suc.whatsapp,
    suc.country as contact_country
FROM 
    profile.user_profile up
JOIN 
    profile.sensitive_user_contact suc ON up.user_id = suc.user_id
WHERE 
    1=1  -- Add your specific filtering conditions here
LIMIT 100;

Hello,

@chris.fajou,
Our development team is aware of Supabase’s plans to transition to JWT signing keys. While I can’t provide an exact timeline or ETA for the update at this moment, please rest assured that we are actively monitoring the situation and will address it in the plugin as soon as possible. We’ll make sure our users can continue using it without disruption.

@steven.h.liu.1,
I’m glad you were able to pinpoint the bottleneck of the issue! Your approach is working, but I’d like to suggest a potential improvement for future scalability and to follow best practices:

Change the Primary Key:

  • Make user_id the primary key in the user_profile table.
  • Then, in the sensitive_user_contact table, create a separate primary key (e.g., contact_id) and use user_id as a foreign key to link both tables.

Schema Design:

  • It’s generally recommended to give each table a unique primary key (e.g., user_profile.id for user_profile and sensitive_user_contact.contact_id for sensitive_user_contact).
  • Use user_id as a foreign key in sensitive_user_contact to link both tables. This ensures that you’re following relational database best practices.

Please note that this is not intended as development advice, but rather a tip to stick to common best practices. Zeroqode’s Technical Support team specializes in plugin knowledge and troubleshooting, and unfortunately, we have limited insights into how Supabase or SQL works. For similar issues in the future, we recommend consulting more specialized resources where you will get more precise and valuable feedback.

If you have further questions regarding the plugin itself, feel free to reach out!

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

1 Like

Hello,

A while back there had been discussion to enable both the “Columns” and Expected response (JSON) fields in the Supabase database element to accept dynamic data. Can this be added to the list of feature requests?

Interestingly, dynamic data is enabled in the fetch action of the Supabase database element. So it would seem that it should not be a difficult feature to implement.

Handling JSON modification becomes quite cumbersome and error prone without a single point to manage changes. In my case, I have been able to use options sets to cleanly manage the Fetch action in the workflow by pointing the column field to the relevant option.

Thank you

Hello @naveenreddyla,

Thank you for reaching out and sharing your suggestion for improving the Supabase database element. We truly appreciate your valuable feedback and your interest in enhancing our products.

To proceed with your request for enabling dynamic data in both the “Columns” and “Expected response (JSON)” fields, we offer the possibility of sponsoring the development of this feature. To begin the review process, kindly complete the Sponsoring Plugin Features Form at the following link: Sponsoring Plugin Features Form.

Once we have your submission, we will evaluate it and provide an estimate of the hours needed, along with the associated costs.

Looking forward to hearing from you soon.

Thank you again for your support!

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Hi @ZeroqodeSupport - I was reading up on your guide re: setting up edge function on the Bubble frontend (LINK). In terms of setting up the API Connector, that is only necessary if the edge function is returning something to the front-end correct?

If I’m to trigger an edge function (say creating a new stripe customer and getting the customer id to be updated in the Supabase backend db), i won’t need to set up the API Connector as a result because there is no expected output going to Bubble.

Am I thinking about this correctly?

_________________________

Also, another quick question re: authentication. Currently, I’m only using the auth_id/user_id for authentication for both the database and edge function. Do I need to set up JWT for each user? If so, how would I do that?

Hello @steven.h.liu.1 ,

Thank you for your query.

Regarding your first question: You are mostly correct. The API Connector is only necessary when the edge function needs to return data to the Bubble frontend for parsing and use within your app. In your case, if the edge function (e.g., creating a new Stripe customer and updating the Supabase backend) does not send output to Bubble, you do not need to set up the API Connector.

However, if your edge function returns a result (as a custom state), you will need to declare this ‘result’ field via the API Connector to properly handle and utilize the response in your Bubble app.

For your second question about authentication: Using auth_id/user_id is sufficient for basic authentication with Supabase, but adding JWT can enhance security, including for edge functions.
The Supabase Pro Kit supports JWT for user authentication. To incorporate JWT in your authentication process, you will need to use the Custom Auth Supabase component. Please check this demo https://supabase-editor.bubbleapps.io/version-test/custom_auth?debug_mode=true and editor pages supabase-editor | Bubble Editor as these have instructions covering the implementation of this logic.

Let us know if you need further assistance!

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

1 Like

Hi @ZeroqodeSupport - thanks for the response.

Three quick follow-up questions:

1/ If I use Supabase auth via Google SSO, does that process already provide its own JWT access code? If so, do I still need to set up JWT via custom auth? Is the custom auth’s JWT mostly for when not using SSO and creating distinct user accounts via user email?

2/ When I invoke the edge function via Bubble frontend, how do I send in my access ID/JWT or user ID as part of the payload? Like this?

3/ Outside of the edge function, if I am to just do an UPSERT in a database, how do I use JWT for authentication vs. sending auth.uuid as part of the JSON payload? I assume this is just automatically done via the plug-in as I don’t see a header field.
____________________________________

EDIT 1.
I set up this edge function. This snippet is just JWT authorization but i can’t get my jwt authenticated when I test it (same access token from above).

    const authHeader = req.headers.get('authorization') || '';
    const token = authHeader.replace('Bearer ', '');
    const userRes = await supabase.auth.getUser({
      access_token: token
    });
    if (userRes.error || !userRes.data.user) {
      return new Response(JSON.stringify({
        error: 'Unauthorized'
      }), {
        status: 401
      });
    }

Here’s part of the raw output and it’s returning the authentication piece empty:

          "method": "POST",
          "pathname": "/functions/v1/jwt_auth_debug",
          "port": null,
          "protocol": "https:",
          "sb": [
            {
              "apikey": [],
              "auth_user": null,
              "jwt": [
                {
                  "apikey": [],
                  "authorization": [
                    {
                      "invalid": null,


Hey @steven.h.liu.1 ,

When you authenticate a user through Supabase Auth (including Google SSO), Supabase automatically issues a signed JWT access token, so there’s no need to create a separate or custom JWT layer.

When calling your Edge Function from Bubble, it might be useful to try to send the token inside a proper HTTP header rather than inside a JSON block. In the Bubble API Connector, add a header with the key Authorization and the value Bearer SupabaseAuth A’s Access token.

If auth_user returns null, that usually means the header wasn’t actually sent, Bubble stripped or reformatted it, or the token has expired — Supabase access tokens are valid for about an hour. Also, there’s no need to manually send auth.uuid in your payloads, since Supabase’s RLS policies handle this automatically through the JWT.

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Hi @ZeroqodeSupport - ty for the response! I do have two follow-up questions on this:

  1. So if I use Google SSO, I don’t need to set up JWT via custom authentication, correct? (Custom authentication is only if I want to register users via Supabase)
  2. Re: returning null. I tried via the Supabase dashboard test as well, and that is also returning a null value. Do you happen to know how to solve this?

Hello,

First question: That’s right — you only need to create a custom JWT if you want to implement a custom authentication system (specifically designed by you to be unique). In all other cases — such as authentication via Supabase or Google SSO — you won’t need to set that up.

Second question: If your Supabase call (or any API call) is returning null or missing authentication info, you can quickly debug it by displaying the raw JSON response on your Bubble page:

  1. Add a Text element to your page.
  2. In the Text content, insert a dynamic expression like:
    Get data from API → [your API call's response]
  3. To view the entire payload clearly, use the :formatted as JSON operator:
    Get data from API → [your API call's response]:formatted as JSON
  4. (Optional) To inspect request headers, you can display them the same way:
    Get data from API → [your API call's headers]:formatted as JSON
  5. Preview the page—you’ll see the full JSON output rendered as text.

This lets you easily verify whether the Authorization header or token is missing or malformed when the request reaches Supabase.

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Hi @steven.h.liu.1 ,

Just wanted to follow up on the guidance we shared regarding Supabase authentication and debugging API responses, as we suggested in the previous message.

Is the issue still relevant on your end? If you’re still running into problems or need help interpreting the output, feel free to share a quick update — we’ll be happy to assist further.

Looking forward to your reply! :blush:

Best regards,
Zeroqode Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3