jeet-kiit-crud
v1.0.8
Published
A simple CRUD client npm package using API key + Postgres
Maintainers
Readme
📚 CRUD Library
🧩 jeet-kiit-crud — API-Key Protected CRUD Client
🔐 A secure, API-key-based CRUD client for use with FormPilot or custom backend APIs.
Built with TypeScript, Axios, and fully Postgres-ready.
📦 Install
npm install jeet-kiit-crud⚙️ Setup
import { CrudLibrary } from "jeet-kiit-crud";
// You should retrieve these from sessionStorage, login response, or env
const crud = CrudLibrary({
apiKey: "your-api-key-here",
apiUrl: "https://your-crud-domain.com/api",
API_TODO_URL: "your-todo-domain"
});🚀 Available Methods
| Method | Description |
|---------------------|---------------------------------------|
| create(data) | Create a new record |
| get(id) | Fetch a single record |
| getAll() | Fetch all records |
| update(id, data) | Update a record |
| remove(id) | Delete a record |
| getCredits() | Check current credit usage |
| getCreditLimit() | Check current credit limit |
| recharge() | Recharge credits via backend approval |
🧠 Example
const res = await crud.create({
value: "Learn NPM packages!",
txHash: "0x123abc",
});
console.log(res.id); // -> New record ID
const all = await crud.getAll();
console.log(all);🔐 Authentication
All requests include the x-api-key header.
Each user has a limited number of credits (default: 4), and they can call recharge() once for an extra 4 credits.
🧪 Use Cases
- ⚡ Intern assignment projects
- 🧾 Billing or credit-tracked APIs
- 🔐 Secure public access to APIs
- 🧱 Shared API client across frontend apps
👨💻 Author
Made with 💙 by Jeet Das
📄 License
This project is licensed under the MIT License.
⭐ Like it?
Give it a ⭐ on GitHub
And tag me if you use it in your own project!
