0.0.5 • Published 4 years ago

@penrodlol/supabaseng v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Setup

npm install @penrodlol/supabaseng

Initialize Supabase Client once during Angular application startup. Supports all SupabaseClientOptions as well.

@NgModule({
  imports: [
    SupabasengModule.initClient({
      url: 'https://xyzcompany.supabase.co',
      key: 'public-anon-key',
			...
    }),
  ],
})
export class AppModule {}

Usage

@Component({...})
export class AppComponent {
  constructor(private supabase: Supabase) {
    const client = this.supabase.client;
    const auth = this.supabase.auth;
    const storage = this.supabase.storage;
  }
}

Performing table operations:

@Component({...})
export class AppComponent {
  constructor(private supabase: Supabase) {
    this.supabase.from<Entity>('items');

	// '...' represents original arguments from supabase-js.
    this.supabase.select<Entity>('items', ...);
    this.supabase.upsert<Entity>('items', ...);
    this.supabase.update<Entity>('items', ...);
    this.supabase.delete<Entity>('items', ...);
  }
}
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago