Skip to content

Commit

Permalink
Update to supabase.js v2
Browse files Browse the repository at this point in the history
  • Loading branch information
DidoMarchet committed Dec 23, 2022
1 parent 4d1d5b8 commit 584c787
Show file tree
Hide file tree
Showing 6 changed files with 362 additions and 280 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vue 3 Supabase.js

:hamburger: Simple [Vue 3](https://github.com/vuejs/docs-next) wrap for [Supabase.js Client](https://supabase.io/docs/reference/javascript/supabase-client) build with [Vitejs](https://github.com/vitejs/vite)
:hamburger: Simple [Vue 3](https://github.com/vuejs/docs-next) wrap for [Supabase.js Client (v2)](https://supabase.io/docs/reference/javascript/supabase-client) build with [Vitejs](https://github.com/vitejs/vite)

### Table of content:
- [Install](#install-plugin)
Expand Down
6 changes: 6 additions & 0 deletions lib/@types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { App } from "vue";

export interface Params {
supabaseUrl: string;
supabaseKey: string;
options?: never;
}

export interface IVueSupabase {
install(app: App, params: Params): void;
}
4 changes: 3 additions & 1 deletion lib/main.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { IVueSupabase } from "./main";
import { IVueSupabase } from "./@types/index";

declare module "@vue/runtime-core" {
interface ComponentCustomProperties {
$supabase: IVueSupabase;
}
}

3 changes: 0 additions & 3 deletions lib/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { App, inject, InjectionKey } from "vue";
import { Params } from "./@types/index";
import { createClient, SupabaseClient } from "@supabase/supabase-js";
export interface IVueSupabase {
install(app: App, params: Params): void;
}

const supabaseInjectionKey: InjectionKey<SupabaseClient> = Symbol();

Expand Down
Loading

0 comments on commit 584c787

Please sign in to comment.