Calling Supabase RPC Functions in Wized

Hi Wized Team,

I’m using Wized with Supabase and would like to call a PostgreSQL RPC function directly instead of using a Supabase Edge Function. I couldn’t find a built-in way in Wized to execute a Supabase RPC.

Hey @littlegeniustoyspvtl!

Wized’s native Supabase connector doesn’t include a Database Function / RPC method — the Invoke Function method is specifically for Supabase Edge Functions only. Edge Functions and Database Functions are distinct in Supabase, so this is a known limitation, not something you’ve missed in the setup.

There are a few solid paths forward depending on your preference.

Option 1 — Access the Supabase JS client directly (recommended)

You can grab the underlying Supabase JS client from Wized and call .rpc() on it inside a custom code action:

window.Wized = window.Wized || [];
window.Wized.push(async (Wized) => {
  const supabase = await Wized.requests.getClient('Supabase App');
  // Replace 'Supabase App' with your exact app name in Wized

  const { data, error } = await supabase.client.rpc('[your_function_name]', {
    [param1]: value1,
    [param2]: value2
  });

  if (error) console.error(error);
  console.log(data);
});

The key part is supabase.client — that gives you the raw @supabase/supabase-js instance, so any method from the JS SDK is available, including .rpc(). You can store the result in a Wized variable from there.

Option 2 — Use a REST Request node

Create a new REST Request in Wized with this config:

  • Method: POST
  • URL: https://[your-project-ref].supabase.co/rest/v1/rpc/[your_function_name]
  • Headers: apikey, Authorization (Bearer token or user JWT), Content-Type: application/json
  • Body: your function’s named parameters as JSON

This keeps everything visible inside the Wized request panel.

Option 3 — Wrap the RPC in an Edge Function

Create a thin Edge Function that calls your Database Function internally, then invoke it via Wized’s built-in Invoke Function method. Adds a layer, but keeps the connector config clean.

For most cases, Option 1 is the quickest win. Option 2 is great if you want the call manageable inside the request panel. Option 3 makes sense if you’re already standardizing on Edge Functions. :flexed_biceps: