GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Windmill
  • Platform
  • Script editor
  • Flow editor
  • App builder
  • Triggers
  • Data tables
  • Deployment & versioning
  • Local dev
  • Workers
  • AI sandboxes
  • Observability
  • RBAC
  • No-ops self-host

This view

  • Original page
  • New address

GeezerVison is showing www.windmill.dev — Supabase integration | Windmill

Supabase is an open-source Firebase alternative.

Learn how to connect to your Supabase project from Windmill Scripts, Flows and Apps.

info

This tutorial assumes that you already have a Windmill account and a Supabase project. If you don't, visit the Windmill documentation or the Supabase documentation to find out more.

Through Postgres protocol​

You can execute queries on Supabase through the regular Postgres protocol.

  1. Sign-up to Supabase's Cloud App or Self-Host it.

  2. Create a new Supabase project.

  3. From Windmill, on the Resources menu click on "Add a resource". Pick "postgresql" and "Add a Supabase DB". This will lead you to a Supabase page where you need to pick your organization. Then on Windmill pick a database, fill with database password and that's it.

Through Supabase API​

Get the API keys​

In order to make authenticated requests to the database, you'll need your API key and the URL of your endpoint from Supabase. To get these, select your project, navigate to the Project Settings page and select API from the menu. You'll find the URL and 2 keys here.

API settings

As the description says, the access level of the public key will be controlled by the policies you add and the secret key will bypass all of them. You can safely use the service_rolesecret secret key in Windmill because it'll never be sent to users directly.

Create a resource​

To safely use secret values throughout Windmill, you can save them in reources. We are regularly updating the list of approved resources but if you want an integration to be supported by Windmill directly, please submit a new resource type on Windmill Hub.

Navigate to the Resources page page Resources page

Click "Add resource" Resource selector

Search for Supabase and select the resource type Resource selector

Enter the API key and the URL from Supabase and click "Save" Resource selector

Use the resource​

You can reference the type of a Supabase resource in a script the following way:

// The type matches the fields of the supabase resource type,
// see https://hub.windmill.dev/resource_types
type Supabase = {
url: string;
key: string;
};

export async function main(auth: Supabase) {
// Function contents
}
tip

You can find more examples and premade Supabase scripts on Windmill Hub.


More tutorials on Supabase:

  • How to Send Database Events From Supabase to Windmill
  • Create an E-commerce backoffice
  • Create an Issue Tracker App with Supabase in 15 Minutes
  • Create an Issue Tracker App with Supabase - Part 2 Customize Your App
  • Use Supabase Authentication on Windmill to query RLS protected tables for external apps
  • Through Postgres protocol
  • Through Supabase API
    • Get the API keys
    • Create a resource
    • Use the resource
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.