0.0.2 • Published 3 years ago

nuxt3-supabase-demo v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

nuxt3-supabase

Supabase for Nuxt 3.

Install

yarn add nuxt3-supabase

Configure

Add the following to your nuxt.config.ts file.

export default defineNuxtConfig({
  modules: ['nuxt3-supabase'],
  supabase: {
    supabaseUrl: process.env.SUPABASE_URL,
    supabaseKey: process.env.SUPABASE_KEY
  },
  vite: false // temporary workaround
});

Usage

<script setup lang="ts">
  const { $supabase } = useNuxtApp();

  const { data, pending } = await useAsyncData('posts', () => {
    return $supabase.from('posts').select();
  });
</script>

<template>
  <div v-if="pending">Loading...</div>
  <div v-else>{{ data }}</div>
</template>

TODO

License

MIT