@smcrm-sdk2/smcrm-sdk
v1.1.0
Published
SMCRM JavaScript SDK for seamless API integration
Readme
🚀 SMCRM SDK
Official JavaScript SDK for seamless integration with SMCRM APIs.
SMCRM SDK allows you to easily connect and manage services like Repair, Clinic, Gym, and Hostel using a single unified API.
📦 Installation
npm install @smcrm-sdk2/smcrm-sdk⚡ CDN Usage
<script src="https://sdk.smcrm.in/smcrm-sdk.min.js" data-api-key="YOUR_API_KEY"></script>🧠 Basic Usage
👉 Node.js / ES Module
import SMCRM from "@smcrm-sdk2/smcrm-sdk";
await SMCRM.init({
apiKey: "YOUR_API_KEY"
});
const services = await SMCRM.getServices();
console.log(services);👉 Browser
<script src="https://sdk.smcrm.in/smcrm-sdk.min.js" data-api-key="YOUR_API_KEY"></script>
<script>
(async () => {
await SMCRM.init();
const services = await SMCRM.getServices();
console.log(services);
})();
</script>🔍 Features
- ✅ Auto Module Detection (Repair, Gym, Clinic, Hostel)
- ✅ API Key Authentication
- ✅ Unified API Structure
- ✅ Works in Browser & Node.js
- ✅ Booking Management System
- ✅ Lightweight & Fast
📚 Available Methods
🔧 Services
SMCRM.getServices()
SMCRM.getSubServices(serviceId)
SMCRM.getServiceSubServices()🏥 Module Specific
SMCRM.getPlans() // Gym
SMCRM.getDoctors() // Clinic📦 Booking
SMCRM.createBooking(data)
SMCRM.getBookings()
SMCRM.cancelBooking(id)🏢 Business
SMCRM.getBusiness()🧪 Example Booking
await SMCRM.createBooking({
customer_name: "Rahul Sharma",
mobile: "8109540259",
service_name: "AC Repair",
service_problem: "Cooling issue"
});📡 API Documentation
👉 https://smcrm.in/documentation
📦 NPM Package
👉 https://www.npmjs.com/package/@smcrm-sdk2/smcrm-sdk
🛠 Configuration
await SMCRM.init({
apiKey: "YOUR_API_KEY",
baseURL: "https://smcrm.in/api",
module: "repairservice" // optional
});⚠️ Error Handling
All responses follow this format:
{
"status": false,
"message": "Error message"
}📄 License
MIT License © SMCRM
