supabase-node-kit
v1.1.0
Published
A backend utility package for Supabase authentication and database functionality.
Readme
Supabase Node Kit
A backend utility package for Supabase authentication and database functionality.
Installation
To install the package, run:
npm install supabase-node-kitConfiguration
Create a .env file in the root of your project and add your Supabase credentials:
SUPABASE_URL=your-supabase-url
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-keyUsage
Authentication Service
import { authService } from "supabase-node-kit";
// Sign up a new user
authService.signUp("[email protected]", "password123");
// Sign in an existing user
authService.signIn("[email protected]", "password123");
// Sign out a user
authService.signOut("user-id");
// Get user details
authService.getUser("user-id");
// Delete a user
authService.deleteUser("user-id");Database Service
import { dbService } from "supabase-node-kit";
// Get all records from a table
dbService.getAll("table_name");
// Get a record by ID
dbService.getById("table_name", 1);
// Insert a new record
dbService.insert("table_name", { column: "value" });
// Update a record by ID
dbService.update("table_name", 1, { column: "new_value" });
// Delete a record by ID
dbService.remove("table_name", 1);License
This project is licensed under the ISC License.
