{"_id":"@eka-care/eka-care-core","_rev":"10-48320b5c482a4811f1f682b8a0c0444b","name":"@eka-care/eka-care-core","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.7":{"name":"@eka-care/eka-care-core","version":"0.1.7","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.1.7","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"3f320ae0adbb1534058effc8b61c893d771c6dd4","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.1.7.tgz","fileCount":6,"integrity":"sha512-Ac1u8q2pZ73Uk5tEegVJhLcsed1nPkSeef+ZBeujx0s3URK5bzNKchjl+bH9vCN60kj9QQwboYrKnWlW+4dKyw==","signatures":[{"sig":"MEUCIQCWHC8HVkIJPGIBSB+9SDS0XhKI3ogzFXj8MJHGQCqpIAIge81lI7sOmLrwEWprYWdyUZo80iBoo9IJqgQaCMwv7Zg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102771},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"39f8a397231461fe435c16fea6b1ac1ea6acef63","scripts":{"dev":"tsup src/createEkaInstance.ts --watch --format esm,cjs --dts --out-dir dist","build":"tsup src/createEkaInstance.ts --format esm,cjs --dts --out-dir dist"},"_npmUser":{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.1.7_1749059997707_0.995770711004726","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"@eka-care/eka-care-core","version":"0.1.8","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.1.8","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"c01299c9ae3aa537c2356c5b393ebf200b71790e","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.1.8.tgz","fileCount":6,"integrity":"sha512-ibpXMDbrnF6UfVD6lTEl6VkmTzkoDRUwOifzLqreDh+svIDm3UURhNtpP+R5FENBllzJPuE6zD0CdTSbUFhaXg==","signatures":[{"sig":"MEUCIQDBilqvXo+sYOAqtYp3BDxYmBbjey30DDn3oO45bA86VQIgN7mfXGTqLuWIrZSOTCD2VjVaM/HFpjsTxy5Hq50WltE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102402},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"39f8a397231461fe435c16fea6b1ac1ea6acef63","scripts":{"dev":"tsup src/createEkaInstance.ts --watch --format esm,cjs --dts --out-dir dist","build":"tsup src/createEkaInstance.ts --format esm,cjs --dts --out-dir dist"},"_npmUser":{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.1.8_1749060317760_0.3052432542941581","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@eka-care/eka-care-core","version":"0.1.9","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.1.9","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"6ec9c428cd4b7c611bf5c56bafe6f4f5a776ab93","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.1.9.tgz","fileCount":6,"integrity":"sha512-6vOSv5nHkW1Ncr1V0Ca6+pQmJxsDFZuuv8ugI+7MSXSHGBplcwUKpCKuqPUgzB+m0lPerC+yapWetY7ENxyKzg==","signatures":[{"sig":"MEQCIB98vOCrS3suiEBz89leSpoq5L+RoTPu15vWQXoDtRT5AiAVAT6ej+xSSRMZvikNaxveZO2d5q6U4Yb7bATtjX+X6A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102398},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"96020bba113b77a5329d1b9020aa0f2ad1f28ef2","scripts":{"dev":"tsup src/createEkaInstance.ts --watch --format esm,cjs --dts --out-dir dist","build":"tsup src/createEkaInstance.ts --format esm,cjs --dts --out-dir dist"},"_npmUser":{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.1.9_1749095492766_0.4569797457804037","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@eka-care/eka-care-core","version":"0.2.0","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.2.0","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"42218e52c34a4f6878d4ad988ba578db8e0b9f17","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.2.0.tgz","fileCount":6,"integrity":"sha512-qyAtJKivabGm9ZiUUa5Eokmd9246VUBum9sH3dQTfYjnRw5TEkm/p1gEN4xwGg9ESuqi140tW3bMO7ZiuQ5yFw==","signatures":[{"sig":"MEUCIQDTf6MGPyuf7tJjaMqRr54yh3vfcvpo/Jp+k1x45fmnSgIgPKE7fakO0sTH122rtlUNhL7xOOCJYZ5ud6f2nd1iXV4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":101989},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"1ec13ff513bbd566a73335cf2accd50070b95545","scripts":{"dev":"tsup src/createEkaInstance.ts --watch --format esm,cjs --dts --out-dir dist","build":"tsup src/createEkaInstance.ts --format esm,cjs --dts --out-dir dist"},"_npmUser":{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.2.0_1749110793104_0.7595439210184922","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@eka-care/eka-care-core","version":"0.2.1","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.2.1","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"fce19b0ec3815035d8ad73de77b84f182e93fad2","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.2.1.tgz","fileCount":7,"integrity":"sha512-qCOMeDeTMbyn7p9R+gxpedKQ+rXsH7li3AJ5oNSv59iHgx8fNgeBtTFyDsv17nG+xjjsPlPd3z15NCPvlawX2A==","signatures":[{"sig":"MEUCIFAEjUEW1axu9LawHudv74uEJWiySg+7QV7GLhriCb8JAiEApbourx6gM7ItdSXAz6ZDMhB8JwNRF7ug7z/lI5tIKe4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128065},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"840c18fcbfa339b50a6471ac970ca1a40cf9dfcd","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"kai-dev","actor":{"name":"kai-dev","type":"user","email":"govind.ganeriwal@eka.care"},"email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.10.0","form-data":"^4.0.3","formdata-node":"^6.0.3","@types/form-data":"^2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.2.1_1751372083498_0.039822584095200675","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@eka-care/eka-care-core","version":"0.2.2","keywords":[],"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","_id":"@eka-care/eka-care-core@0.2.2","maintainers":[{"name":"gauthamlaleka","email":"gautham.lal@eka.care"},{"name":"geethanjali.s","email":"geethanjali.s@eka.care"},{"name":"jainkuniya-eka","email":"Vishwesh.Jainkuniya@eka.care"},{"name":"vikalpsahni","email":"vikalp@eka.care"},{"name":"muhammedarshadtk","email":"muhammedarshadtk@eka.care"},{"name":"karthickeka","email":"karthick@eka.care"},{"name":"devops-orbi","email":"devops@eka.care"},{"name":"kai-dev","email":"govind.ganeriwal@eka.care"},{"name":"ekaraghunandan","email":"rags@eka.care"}],"dist":{"shasum":"1d89efbee21bb0e0c7eb0013360b669ea507c655","tarball":"https://registry.npmjs.org/@eka-care/eka-care-core/-/eka-care-core-0.2.2.tgz","fileCount":7,"integrity":"sha512-8JFKd2hJGI9sC4RbxnQhMxn00Yp18LgP0RyluD9VsSn2US5/6b085AMvsLTsEzPvv8RZbW1meyUQeinga0jb6A==","signatures":[{"sig":"MEQCIH8T7KANFLsaxloPFwg3QLA0DbVIletw5ThAzbq/NBWOAiAR5e75XgPdo2tF+Cng3kx5+k42YmfH6h7KtVFHTbDXTg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128065},"main":"dist/createEkaInstance.js","types":"dist/createEkaInstance.d.ts","exports":{".":{"import":"./dist/createEkaInstance.js","require":"./dist/createEkaInstance.js"}},"gitHead":"840c18fcbfa339b50a6471ac970ca1a40cf9dfcd","scripts":{"dev":"tsup --watch","build":"tsup"},"_npmUser":{"name":"kai-dev","actor":{"name":"kai-dev","type":"user","email":"govind.ganeriwal@eka.care"},"email":"govind.ganeriwal@eka.care"},"_npmVersion":"10.8.2","description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","directories":{},"_nodeVersion":"18.20.8","dependencies":{"axios":"^1.10.0","form-data":"^4.0.3","formdata-node":"^6.0.3","@types/form-data":"^2.2.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","typescript":"^5.8.3","@types/node":"^22.15.24"},"_npmOperationalInternal":{"tmp":"tmp/eka-care-core_0.2.2_1751384791034_0.8988431755085522","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-06-04T17:59:57.603Z","modified":"2026-05-29T14:28:56.195Z","0.1.7":"2025-06-04T17:59:57.891Z","0.1.8":"2025-06-04T18:05:17.984Z","0.1.9":"2025-06-05T03:51:32.934Z","0.2.0":"2025-06-05T08:06:33.287Z","0.2.1":"2025-07-01T12:14:43.689Z","0.2.2":"2025-07-01T15:46:31.221Z"},"author":{"name":"Govind govind.ganeriwal@eka.care"},"license":"MIT","keywords":[],"description":"Official TypeScript SDK for EKA Healthcare APIs - Appointments, Patients, Assessment & more","maintainers":[{"email":"sachin.jaiswal@eka.care","name":"sachinjaiswal-eka"},{"email":"savita.verma@eka.care","name":"savitaverma"},{"email":"shekhar.gupta@eka.care","name":"eka_shekhar"},{"email":"shyamjith.palakkandy@eka.care","name":"shyameka"},{"email":"geethanjali.s@eka.care","name":"geethanjali.s"},{"email":"Vishwesh.Jainkuniya@eka.care","name":"jainkuniya-eka"},{"email":"vikalp@eka.care","name":"vikalpsahni"},{"email":"muhammedarshadtk@eka.care","name":"muhammedarshadtk"},{"email":"karthick@eka.care","name":"karthickeka"},{"email":"devops@eka.care","name":"devops-orbi"},{"email":"govind.ganeriwal@eka.care","name":"kai-dev"},{"email":"rags@eka.care","name":"ekaraghunandan"}],"readme":"# Eka Care SDK\n\nA comprehensive TypeScript SDK for integrating with Eka Care's healthcare APIs. Built for **Ekathon** (Eka Care Hackathon) with full TypeScript support and TS based autocomplete on `payload`, `fns`, return `responses`.\n\n---\n\n## 🚀 Features\n\n- **Complete TypeScript Support** - Full type safety with intelligent autocomplete\n- **Healthcare Module Coverage** - Appointments, Patients, Medications, Health Assessments, ABHA (coming soon)\n- **Easy Integration** - Simple setup for Node.js, Next.js, and React applications\n- **Production Ready** - Robust error handling and validation\n- **Auth** - you as a third party dev dont need to worry about auth or refresh token. since the SDK takes care of it. and everytime you call any of the SDK modules and fns it will automatically manage the auth token and its life-cycle and renewal\n\n---\n\n## 📦 Installation\n\n```bash\nnpm install @eka-care/eka-care-core\n```\n\n---\n\n## ⚠️ IMPORTANT NOTE BEFORE YOU START USING THE SDK ⚠️\n\nThe SDK can be used on both BE and FE — just with different configs.\n\nIf you initialize the SDK in a backend JS/TS runtime like Node, Express, Next, etc., you can use a straightforward config. We’ve also made it FE-compatible with a slightly different setup.\n\n---\n\n### ✅ Setup for BE runtimes\n\nYou can initialize the SDK in your **backend** environment by simply passing the `client_id`, `client_secret`, and `api_key`.\n\n> ⚠️ Make sure to store these credentials securely and never expose them on the frontend.\n\n```ts\nimport createEkaInstance from \"@eka-care/eka-care-core\";\n\nconst myEka = createEkaInstance({\n  client_id: \"your_client_id\",\n  client_secret: \"your_client_secret\",\n  api_key: \"your_api_key\",\n});\n```\n\n---\n\n### ✅ Setup for FE runtimes (React, Next.js, etc.)\n\nTo use the SDK in a client-side web app, you'll need to use a token-based flow and set up a small backend auth proxy. Here's how:\n\n```ts\n// NOTE: This API endpoint is already written — you can deploy it with one click,\n// add your env variables, and have it running on your Vercel account. More on that below.\n\n// Client side FE code ——>\nconst authRes = await fetch(\"https://your-backend.vercel.app/api/manage-auth\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n});\n\nconst authData = await authRes.json();\n\nconst ekaInstanceResult = createEkaInstance({\n  source: \"FE\",\n  auth_token: authData.data.access_token,\n  backendAuthEndpointURL:\n    \"https://vercel-clone-from-eka-account-next.vercel.app/api/manage-auth\", // make sure this is the full URL: https + your Vercel domain + the API route\n});\n```\n\nAnd you're GTG! You can initialize it once (maybe in a `useEffect` with empty dependencies) and take it for a spin. The SDK is now fully FE-compatible.\n\n---\n\n### 🔧 Get the backend up and running for FE auth\n\n⚠️ Only needed if you're using the SDK on the frontend.\n\nWe have starter templates you can deploy instantly:\n\n- [Express Auth Template](https://github.com/eka-care/ekathon-express-auth-template-api)\n- [Next.js Auth Template](https://github.com/eka-care/ekathon-nextjs-auth-template-api)\n\none click deployment button in the repo's readme\nUse these to deploy the `/api/manage-auth` route mentioned above.\nhence\n\n- deploy the repo that you wish to use (express or Next)\n- follow the deployment guidelines in the repo's readme\n- have the backend up and running\n  and you can now initialize the SDK on FE as well\n\n- by first calling the backend api that you just deployed, and getting the auth token\n\n```ts\nconst authRes = await fetch(\"https://your-backend.vercel.app/api/manage-auth\", {\n  method: \"POST\",\n  headers: { \"Content-Type\": \"application/json\" },\n});\n\nconst authData = await authRes.json();\n```\n\n- and initing the SDK on client side\n\n```ts\nconst ekaInstanceResult = createEkaInstance({\n  source: \"FE\",\n  auth_token: authData.data.access_token, // passing the auth token that you received from the above API call\n  backendAuthEndpointURL:\n    \"https://vercel-clone-from-eka-account-next.vercel.app/api/manage-auth\", // make sure this is the full URL: https + your Vercel domain + the API route\n});\n```\n\n---\n\n### Setup for BE runtimes\n\n```typescript\nimport createEkaInstance from \"@eka-care/eka-care-core\";\n\nconst myEka = createEkaInstance({\n  client_id: \"your_client_id\",\n  client_secret: \"your_client_secret\",\n  api_key: \"your_api_key\",\n});\n```\n\n### Next.js API Route Example\n\n```typescript\n// pages/api/healthcare.ts\nimport createEkaInstance from \"@eka-care/eka-care-core\";\n\nconst myEka = createEkaInstance({\n  client_id: process.env.EKA_CLIENT_ID,\n  client_secret: process.env.EKA_CLIENT_SECRET,\n  api_key: process.env.EKA_API_KEY,\n});\n\nexport default async function handler(req, res) {\n  try {\n    const slots = await myEka.appointments.getSlotsForDoctor({\n      doctor_id: \"doc123\",\n      clinic_id: \"clinic456\",\n      start_date: \"2025-06-05\",\n      end_date: \"2025-06-06\",\n    });\n\n    res.status(200).json({ success: true, data: slots });\n  } catch (error) {\n    res.status(500).json({ error: error.message });\n  }\n}\n```\n\n---\n\n## 📚 Module Documentation\n\n### 🏥 Appointments Module\n\nManage doctor appointments and schedules.\n\n```typescript\n// Get available slots for a doctor\nconst slots = await myEka.appointments.getSlotsForDoctor({\n  doctor_id: \"doc123\",\n  clinic_id: \"clinic456\",\n  start_date: \"2025-06-01\",\n  end_date: \"2025-06-01\",\n});\n\n// Book an appointment\nconst appointment = await myEka.appointments.bookAppointmentSlotForDoctor({\n  isBusinessOrDoctorAssosiatedWithEka: true,\n  clinic_id: \"clinic456\",\n  doctor_id: \"doc123\",\n  patient_id: \"patient789\",\n  appointment_details: {\n    start_time: 1748607760,\n    mode: \"INCLINIC\", // or \"TELE\"\n  },\n  patient_details: {\n    dob: \"2004-08-01\",\n    first_name: \"John\",\n    gender: \"M\",\n  },\n});\n\n// Get appointments by date\nconst appointments = await myEka.appointments.getAllAppointmentsByDate(\n  \"01-06-25\"\n);\n\n// Get appointment details\nconst details = await myEka.appointments.getAppointmentDetailsById({\n  appointment_id: \"apt123\",\n});\n\n// Manage appointment status\nawait myEka.appointments.parkAppointment({ appointment_id: \"apt123\" });\nawait myEka.appointments.completeAppointment({ appointment_id: \"apt123\" });\nawait myEka.appointments.cancelAppointment({ appointment_id: \"apt123\" });\n```\n\n### 👥 Patients Module\n\nPatient registration and management.\n\n```typescript\n// Add new patient to directory\nconst newPatient = await myEka.patients.addPatientToDirectory({\n  first_name: \"John\",\n  gender: \"M\",\n  mobile: \"918074106021\",\n  dob: \"2004-08-01\",\n});\n\n// Search patient by mobile number\nconst patient = await myEka.patients.searchPatientByMobile({\n  mobile: \"918074106021\",\n});\n\n// Get patient details by ID\nconst patientDetails = await myEka.patients.getPatientDetailsById({\n  patient_id: \"174860072074280\",\n});\n```\n\n### 💊 Medication Search Module\n\nSearch and find medications.\n\n```typescript\n// Search by drug name\nconst medications = await myEka.medicationSearch.searchMedications({\n  drug_name: \"paracetamol\",\n});\n\n// Advanced search with multiple parameters\nconst advancedSearch = await myEka.medicationSearch.searchMedications({\n  drug_name: \"dolo\",\n  form: \"tablet\",\n  volumes: \"500\",\n});\n\n// Search by generic names\nconst genericSearch = await myEka.medicationSearch.searchMedications({\n  generic_names: \"Glimeperide,Metformin\",\n  drug_name: \"Glimeperide\",\n});\n```\n\n### 🩺 Health Assessment Module\n\nComprehensive health assessment and symptom checking.\n\n```typescript\n// Initialize assessment\nconst assessment = await myEka.assessment.initAssessment({\n  client_id: \"your_client_id\",\n  user_info: {\n    gender: \"M\",\n    age: 25,\n  },\n  workflow_id: 814, // Symptom checker workflow\n});\n\n// Start assessment\nconst startResponse = await myEka.assessment.startAssessment({\n  assessment_id: assessment.assessment_id,\n  client_id: \"your_client_id\",\n});\n\n// Handle different question types with full TypeScript support\nconst question = startResponse.questions[0];\n\nif (question.component_code === \"I-RADG\") {\n  // Radio group with qualifiers (Yes/No/Don't Know)\n  const choices = question.component_data.choices; // ✅ Autocomplete works!\n\n  const userResponse = [\n    {\n      selected_choices: [\n        {\n          choice_id: choices[0].choice_id,\n          choice_label: choices[0].choice_label,\n          choice_qualifier: \"p\", // \"p\" = Yes, \"a\" = No, \"u\" = Don't Know\n        },\n      ],\n    },\n  ];\n} else if (question.component_code === \"I-MULT\") {\n  // Multiple choice selection\n  const choices = question.component_data.choices; // ✅ Autocomplete works!\n\n  const userResponse = [\n    {\n      selected_choices: choices.slice(0, 2).map((choice) => ({\n        choice_id: choice.choice_id,\n        choice_label: choice.choice_label,\n      })),\n    },\n  ];\n} else if (question.component_code === \"I-ATSG\") {\n  // Autosuggest symptoms\n  const staticChoices = question.component_data.autosuggest_static_choices; // ✅ Autocomplete works!\n\n  const availableChoices = staticChoices.sections[0]?.choices || [];\n  const userResponse = [\n    {\n      selected_choices: availableChoices.slice(0, 2).map((choice) => ({\n        choice_id: choice.choice_id!,\n        choice_label: choice.choice_label || choice.common_name!,\n      })),\n    },\n  ];\n}\n\n// Continue assessment\nconst continueResponse = await myEka.assessment.continueAssessment({\n  assessment_id: assessment.assessment_id,\n  client_id: \"your_client_id\",\n  qid: question.qid,\n  user_response: userResponse,\n});\n\n// Submit final assessment\nconst results = await myEka.assessment.submitAssessment({\n  assessment_id: assessment.assessment_id,\n  client_id: \"your_client_id\",\n});\n\nconsole.log(\"Health Assessment Results:\", results.likelihood);\n```\n\n### 🎙️ Eka Scribe Module\n\nEkascribe allows you to transcribe audio files into structured medical data. The TS SDK simplifies this integration, by handling auth internally and exposing 2 simple functions `uploadAudioFileAndStartTranscription` and `getTranscribedData`\n\nEka Care supports multiple output templates for different medical documentation needs. Choose the appropriate template ID based on your requirements:\n\n| Template ID               | Description                                                      | Use Case                                              |\n| ------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------- |\n| `clinical_notes_template` | Comprehensive clinical notes with structured medical information | General clinical documentation, patient consultations |\n| `eka_emr_template`        | EMR-compatible format for electronic medical records             | Integration with EMR systems                          |\n| `transcript_template`     | Basic transcription with minimal structuring                     | Simple audio-to-text conversion                       |\n\n## Supported Input Languages\n\nEka Care supports transcription in multiple languages. Specify the appropriate language ID in the `input_language` parameter:\n\n| Language ID | Language Name           |\n| ----------- | ----------------------- |\n| `en-IN`     | English (India)         |\n| `en-US`     | English (United States) |\n| `hi`        | Hindi                   |\n| `gu`        | Gujarati                |\n| `kn`        | Kannada                 |\n| `ml`        | Malayalam               |\n| `ta`        | Tamil                   |\n| `te`        | Telugu                  |\n| `bn`        | Bengali                 |\n| `mr`        | Marathi                 |\n| `pa`        | Punjabi                 |\n\n## Step 1: Register Webhook (One-time Setup)\n\nBefore using the Ekascribe service, register a webhook to receive notifications when transcription is complete:\n\n```bash\ncurl --request POST \\\n  --url https://api.eka.care/notification/v1/connect/webhook/subscriptions \\\n  --header 'Authorization: Bearer <auth_token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"event_names\": [\n      \"v2rx.completed\"\n    ],\n    \"endpoint\": \"your-endpoint-url\",\n    \"signing_key\": \"supersecretkey\",\n    \"protocol\": \"https\"\n  }'\n```\n\nthen from any FE or BE JS based runtimes prepare your payload with the voice recordings and additional data\n\npsudo react code to execute on click of a submit button\n\n```js\nconst handleSubmit = async () => {\n  const response =\n    await ekaInstance.ekaScribe.uploadAudioFileAndStartTranscription({\n      txn_id: \"717312jkjs212313jj1\",\n      files: selectedFiles, // array of audio files. can be taken from the user/your app with the <input /> tag.\n      input_language: [\"en-US\"],\n      output_format_template: [\n        {\n          codification_needed: true,\n          template_id: \"clinical_notes_template\",\n        },\n        {\n          codification_needed: false,\n          template_id: \"eka_emr_template\",\n        },\n      ],\n      mode: \"consultation\",\n      transfer: \"non-vaded\",\n    });\n  console.log(response, \"response\");\n};\n```\n\npsudo code when uploading from a Node JS environment\n\n```js\n(async () => {\n  try {\n    await ekaInstance.ekaScribe.uploadAudioFileAndStartTranscription({\n      files: [\"/Users/govindganeriwal/Desktop/testReco1.m4a\"],\n      input_language: [\"en-US\", \"en-IN\"],\n      output_format_template: [\n        {\n          codification_needed: true,\n          template_id: \"clinical_notes_template\",\n        },\n        {\n          codification_needed: false,\n          template_id: \"eka_emr_template\",\n        },\n      ],\n      mode: \"consultation\",\n      transfer: \"non-vaded\",\n      txn_id: \"9f14c5ba-ee0b-4642-8f38-4\",\n    });\n  } catch (e) {\n    console.log(\"error\", e);\n  }\n})();\n```\n\nand then to get the result back,\npsudo code\n\n```js\nconst transcribedData = await ekaInstance.ekaScribe.getTranscribedData({\n  session_id: `9f14c5ba-ee0b-4642-8f38-4` // is the same as transaction id\n})\nconsole.log(transcribedData.data.output);\n\n// when the transcription is successful it returns this kind of a response\n\n{\n\"data\": {\n    \"output\": [\n        {\n            \"template_id\": \"clinical_notes_template\",\n            \"value\": \"<base 64 encoded data>\",\n            \"type\": \"markdown\",\n            \"name\": \"Clinical Notes\",\n            \"status\": \"success\",\n            \"errors\": [],\n            \"warnings\": []\n        },\n        {\n            \"template_id\": \"eka_emr_template\",\n            \"value\": \"<base 64 encoded data>\",\n            \"type\": \"eka_emr\",\n            \"name\": \"Eka EMR Format\",\n            \"status\": \"success\",\n            \"errors\": [],\n            \"warnings\": []\n        }\n    ],\n    \"additional_data\": {}\n}\n}\n// make sure to decode the data.output.value —— could be something as simple as using `atob`\n```\n\n---\n\n## 🎯 TypeScript Autocomplete\n\nThe SDK provides full TypeScript support with intelligent autocomplete. Press `Ctrl+Space` to see available options, methods, args and responses:\n\n![TypeScript Autocomplete](https://img.shields.io/badge/TypeScript-Autocomplete-blue)\n\n```typescript\n// Autocomplete works throughout the entire SDK\nmyEka. // Shows all available modules\nmyEka.assessment. // Shows all assessment methods\nmyEka.appointments. // Shows all appointment methods\n\n// Type safety for parameters\nawait myEka.appointments.getSlotsForDoctor({\n  // Autocomplete shows required fields\n  doctor_id: \"\", // ✅ Required\n  clinic_id: \"\", // ✅ Required\n  start_date: \"\", // ✅ Required\n  end_date: \"\", // ✅ Required\n});\n```\n\n---\n\n## 🔧 Configuration\n\n### Environment Variables\n\nCreate a `.env.local` file:\n\n```bash\nEKA_CLIENT_ID=your_client_id\nEKA_CLIENT_SECRET=your_client_secret\nEKA_API_KEY=your_api_key\n```\n\n### TypeScript Configuration\n\nEnsure your `tsconfig.json` includes:\n\n```json\n{\n  \"compilerOptions\": {\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true\n  }\n}\n```\n\n## 📋 Response Types\n\nAll methods return properly typed responses:\n\n```typescript\n// Assessment results are fully typed\ninterface LikelihoodItem {\n  id: string;\n  desc: string;\n  text: string;\n  likelihood: string;\n  relevant_doctor_specialities: string[];\n}\n\n// Appointment data is structured\ninterface AppointmentDetails {\n  appointment_id: string;\n  status: string;\n  start_time: number;\n  // ... and more\n}\n```\n\n---\n\n## ⚡ Error Handling\n\nThe SDK would never break the app and has try/catch at every important step. but for proper UX its recommended to wrap its usage with your own try/catch or .then and .catch\n\n```typescript\ntry {\n  const result = await myEka.appointments.getSlotsForDoctor({\n    doctor_id: \"invalid\",\n    clinic_id: \"invalid\",\n    start_date: \"2025-06-01\",\n    end_date: \"2025-06-01\",\n  });\n} catch (error) {\n  console.error(\"API Error:\", error.message);\n  // Handle error appropriately\n}\n```\n\n# 📋 Requirements\n\n- Node.js 16+\n- TypeScript 4.5+ (recommended)\n- Valid EKA Healthcare API credentials\n\n---\n","readmeFilename":"README.md"}