UNPKG

supabase-node-kit

Version:

A backend utility package for Supabase authentication and database functionality.

69 lines (44 loc) 1.32 kB
# Supabase Node Kit A backend utility package for Supabase authentication and database functionality. ## Installation To install the package, run: ```bash npm install supabase-node-kit ``` ## Configuration 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 ``` ## Usage ### Authentication Service ```typescript 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"); ``` ### Database Service ```typescript 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.