vue-supabase
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

Vue + Supabase

A supa simple wrapper around Supabase.js to enable usage within Vue.

Installation

# Vue 3.x
yarn add vue-supabase

# Vue 2.x
yarn add @vue/composition-api vue-supabase

Note: Currently @vue/composition-api is required for this package to work for projects using Vue 2.x.

Usage

Vue 2.x

import VueSupabase from "vue-supabase";

Vue.use(VueSupabase, {
  supabaseUrl: "",
  supabaseKey: "",
  supabaseOptions: {},
});
const { data, error } = await this.$supabase.from("events").select("*");

Vue 3.x

import VueSupabase from 'vue-supabase'

const app = createApp(...)

app.use(VueSupabase, {
  supabaseUrl: '',
  supabaseKey: '',
  supabaseOptions: {}
})

app.mount(...)

Options API

const { data, error } = await this.$supabase.from("events").select("*");

Composition API

import { useSupabase } from "vue-supabase";

const supabase = useSupabase();

const { data, error } = await supabase.from("events").select("*");

Here are a couple of composables available with Vue 3.x or Vue 2.x + Composition API

import { useSuabaseAuth, useSupabaseStorage } from "vue-supabase";

const auth = useSupabaseAuth();
const storage = useSupabaseStorage();
const { data } = await storage.listBuckets();
await auth.signOut();

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.3.015latest

Version History

VersionDownloads (Last 7 Days)Published
2.3.015
2.2.41
2.2.30
2.2.20
2.2.10
2.1.00
2.1.0-beta30
2.1.0-beta20
2.0.00
1.0.63
1.0.40
1.0.4-pre.30
1.0.4-pre.20
1.0.4-pre.10
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i vue-supabase

Weekly Downloads

18

Version

2.3.0

License

MIT

Unpacked Size

26.1 kB

Total Files

37

Last publish

Collaborators

  • scottymeuk