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

0.0.3 • Public • Published

NgxSupabase

Angular Module to use supabase with angular.

get started

install it

npm i ngx-supabase

add it to your module

import { NgxSupabaseModule } from 'ngx-supabase';
import { NgxSupabaseConfig } from "ngx-supabase";

export const config: NgxSupabaseConfig = {
  supabaseUrl: "",
  supabaseKey: "",
};

@NgModule({
  imports: [
    ...,
    NgxSupabaseModule.forRoot(config),
  ],
})
export class YourModule {}

and you are ready to go.

NgxSupabaseService is now available via DI

constructor(private supabase: NgxSupabaseService) {
  // this.supabase.user
  // this.supabase.rest
}

API

  • user

    this.supabase.user
signUp(value: UserCredentials): Observable<NgxAuthResponse>
signIn(value: UserCredentials): Observable<NgxAuthResponse>
user(): User | null
 logOut(): Observable<Error | null>
 update(
    attributes: UserAttributes
  ): Observable<{ data: User | null; user: User | null; error: Error | null }>
  • rest

    this.supabase.rest
selectFrom(
    tbl: string,
    params?: SelectFromParams
  ): Observable<NgxSupaBaseSuccessResponse[]>
getCollumsFrom(tbl: string): Observable<string[]>
insertInto(
    tbl: string,
    data: { [key: string]: any }[],
    upsert = false
  ): Observable<NgxSupaBaseSuccessResponse[]>
updateIn(
    tbl: string,
    data: { [key: string]: any },
    params: SelectFromParams
  ): Observable<NgxSupaBaseSuccessResponse[]>
deleteFrom(tbl: string, params: SelectFromParams)

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-supabase

Weekly Downloads

0

Version

0.0.3

License

none

Unpacked Size

98.2 kB

Total Files

24

Last publish

Collaborators

  • web-dave