npm install @triniwiz/nativescript-supabase
import {createClient} from '@triniwiz/nativescript-supabase';
const client = createClient('supabaseUrl', 'supabaseKey');
// Select from table `countries` ordering by `name`
const response = await client
.from('countries')
.select()
.order('name', ascending: true)
.execute();
}
import {createClient} from '@triniwiz/nativescript-supabase';
const client = createClient('supabaseUrl', 'supabaseKey');
// Sign up user with email and password
const response = await client.auth.signUp('email', 'password');
import {File as nsFile, knownFolders, path} from '@nativescript/core';
import {createClient} from '@triniwiz/nativescript-supabase';
const client = createClient('supabaseUrl', 'supabaseKey');
// Create file `example.txt` and upload it in `public` bucket
const exampleText = path.join(knownFolders.documents().path, 'example.txt');
const file = nsFile.fromPath(exampleText);
file.writeTextSync('File content');
const storageResponse = await client
.storage
.from('public')
.upload('example.txt', exampleText);
Check out the Official Documentation to learn all the other available methods.
Based on supabase-js
Apache License Version 2.0