Medme ADT SDK
npm install @med.me/adt-sdkMedme ADT SDK - TypeScript client library for ADT API
``bash`
npm install @med.me/adt-sdkor
yarn add @med.me/adt-sdk
`typescript
import { OpenAPI, PatientService, ActivityService } from '@med.me/adt-sdk';
// Configure the API client
OpenAPI.BASE = 'http://localhost:5000';
OpenAPI.TOKEN = 'your-auth-token';
// Use the services
const patients = await PatientService.getPatients();
const activities = await ActivityService.getActivities();
`
1. Make sure the ADT backend (adt-core) is running on http://localhost:5000
2. Ensure you have the required dependencies installed
#### 1. Update Backend API Schema
In the adt-core project:`bash`
yarn gen:openapi # Generate updated openapi.json
yarn start:dev # Start server to serve OpenAPI schema
#### 2. Regenerate SDK Code
In the adt-sdk project:`bashInstall dependencies (first time only)
yarn install
#### 3. Update Frontend Project
In the
adt-front project:
`bash
Update SDK dependency
yarn install
`$3
When updating the SDK with new changes:
1. Update version in
package.json:
`bash
npm version patch # for bug fixes
npm version minor # for new features
npm version major # for breaking changes
`2. Build and test:
`bash
yarn build
`3. Publish (if using npm registry):
`bash
npm publish
`$3
-
yarn codegen-local - Generate SDK code from local backend API
- yarn build - Build the SDK for distributionProject Structure
`
src/
├── core/ # Core API utilities
├── models/ # TypeScript type definitions
├── services/ # API service classes
└── index.ts # Main export file
`Notes
- The SDK is automatically generated from OpenAPI specification
- Do not manually edit generated files in
src/ - they will be overwritten
- Always use the codegen-local script to update the SDK
- The SDK uses fetch API client for HTTP requestsTroubleshooting
$3
1. "openapi command not found"
`bash
yarn add -D openapi-typescript-codegen
`2. Backend not responding
- Ensure
adt-core is running on port 5000
- Check that /openapi-json` endpoint is accessible3. Build errors after regeneration
- Check for naming conflicts in generated types
- Verify OpenAPI schema is valid
If you encounter issues during SDK update:
1. Check that backend API is running and accessible
2. Verify the OpenAPI schema is valid
3. Review generated code for any obvious issues
4. Check console for specific error messages