A backend utility package for Supabase authentication and database functionality.
To install the package, run:
npm install supabase-node-kit
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-key
import { authService } from "supabase-node-kit";
// Sign up a new user
authService.signUp("user@example.com", "password123");
// Sign in an existing user
authService.signIn("user@example.com", "password123");
// Sign out a user
authService.signOut("user-id");
// Get user details
authService.getUser("user-id");
// Delete a user
authService.deleteUser("user-id");
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);
This project is licensed under the ISC License.