Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can connect Supabase to a Nuxt app with the direct @supabase/supabase-js client, or use @nuxtjs/supabase when you want Nuxt-oriented helpers for authentication and related workflows. The quickest route to a working table query is to create a Supabase project, enable Row Level Security (RLS) on a table, configure the project URL and publishable key in Nuxt, then query the table from a composable. One lifecycle caveat matters: Nuxt 3 reached end of life on 31 July 2026, so check the supported Nuxt release before choosing Nuxt 3 for a new production app.

Choose a Supabase integration for your Nuxt app

For a small app that needs an explicit database query, install @supabase/supabase-js and create the client yourself. For an app that needs Nuxt-integrated authentication helpers and a broader user workflow, consider the @nuxtjs/supabase module. Supabase’s direct-client quickstart and its separate Nuxt user-management tutorial demonstrate these different approaches.

Approach What it provides Best fit
@supabase/supabase-js You configure and create the Supabase client directly; the quickstart shows a table read. A minimal query or a project that benefits from keeping client setup explicit.
@nuxtjs/supabase A Nuxt module wrapping supabase-js, with auto-configured helpers and authentication support; its documentation describes Nuxt 3 and 4 readiness. A Nuxt app that wants integrated Auth helpers or plans for user, profile, and Storage workflows.

These are alternative integration paths, not steps to combine. The direct client sample below is deliberately focused on reading a table; the module route is the better starting point if your immediate goal is Nuxt-integrated auth and account features. Review the module’s version compatibility against the Nuxt release you intend to use.

Build a minimal Nuxt app that reads a Supabase table

1. Create the Supabase project and protect the table

Create a project in the Supabase Dashboard. The official quickstart then creates an instruments table, inserts sample rows, grants the necessary Postgres privileges, enables RLS, and adds a policy that permits the anon role to read that sample table. Follow the current Supabase Nuxt quickstart for the SQL and Dashboard steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

RLS belongs in the initial setup, not as a deployment afterthought. The sample’s public-read policy is appropriate only for its demonstration data. Do not copy it to a table containing private or user-owned records: write policies that restrict access to the intended users and operations.

2. Initialize Nuxt and install the client

The documented initialization command is:

npx nuxi@latest init my-app

For a non-interactive shell, use the documented options:

npx nuxi@latest init my-app --template minimal --no-gitInit --packageManager npm

Install the direct client library from the new project directory:

cd my-app && npm install @supabase/supabase-js

3. Configure the project URL and publishable key

In Nuxt configuration, define public runtime values for the Supabase project URL and publishable key. For example, the quickstart’s composable expects config.public.supabaseUrl and config.public.supabasePublishableKey. Supply the values through environment configuration for local development and deployment, rather than committing secrets or environment-specific credentials to source control.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The publishable key is intended for client-side use; it does not replace database security. RLS and the privileges and policies on exposed tables remain responsible for controlling data access. Never put a privileged secret key in public runtime configuration.

4. Create a composable for the client

Create app/composables/useSupabase.ts:

export const useSupabase = () => {
  const config = useRuntimeConfig()

  return createClient(
    config.public.supabaseUrl,
    config.public.supabasePublishableKey
  )
}

This uses Nuxt’s auto-imported composable support for files in app/composables/. It returns a Supabase client configured with the two runtime values.

5. Query the table from a component

In a component, call from('instruments').select(), keep the result in a Vue ref, and handle any returned error. The official quickstart runs the request from onMounted, so the list is populated after the browser page loads:

<script setup lang="ts">
import { onMounted, ref } from 'vue'

const instruments = ref([])
const fetchError = ref('')
const supabase = useSupabase()

onMounted(async () => {
  const { data, error } = await supabase.from('instruments').select()

  if (error) {
    fetchError.value = error.message
    return
  }

  instruments.value = data ?? []
})
</script>

<template>
  <p v-if="fetchError">Could not load instruments: {{ fetchError }}</p>
  <ul v-else>
    <li v-for="instrument in instruments" :key="instrument.id">
      {{ instrument.name }}
    </li>
  </ul>
</template>

Adjust displayed fields and the key to match the columns in your table. If the query returns no rows, check that sample data exists and that the applicable grants and RLS policy allow the request’s role to read it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Run the app

Start the development server:

npm run dev

Open http://localhost:3000. The sample request runs when the component mounts in the browser; it is not an example of server-rendered data loading.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep database access safe beyond the sample

Before deployment, review every table and policy, and expose only the tables or functions the app needs through the Data API. Move environment values into your deployment environment configuration. When preparing a live deployment, the Supabase quickstart also recommends configuring a custom Supabase domain.

  • Enable RLS on tables that are reachable through the API and define policies for the intended users and operations.
  • Do not treat a publishable key as a substitute for authorization; permissions and RLS determine what a caller can access.
  • Keep service-role or other privileged credentials server-side and out of client bundles.
  • Check both the database policy and application behavior when a query fails or returns no rows.

Add authentication, profiles, and avatar uploads

For a user-management app, Supabase’s Nuxt tutorial uses Database, Auth, and Storage together. Its workflow covers identifying accounts, signing in with email magic links, storing and updating profile information, and uploading profile photos. RLS policies restrict users to their own information. See the Supabase Nuxt 3 user-management tutorial for that integrated example.

This is a different scope from the one-table read above: account workflows require policies designed around ownership, and avatar uploads need Storage configuration and access rules as well as a database profile. The Nuxt Supabase module may be useful when you want Nuxt-oriented Auth helpers; verify its compatibility with the Nuxt version selected for your project.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nuxt 3’s support status in 2026

Nuxt’s installation documentation states that “Nuxt 3 reached end of life on 31 July 2026.” Its current installation path documents Node.js 22.x or newer. Because Nuxt 3 has reached end of life by that date, treat Nuxt 3-specific tutorials as compatibility references or guides for existing applications, and assess a supported Nuxt release before starting a new production project. Check Nuxt’s installation documentation for current setup guidance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.