PatientPulse ships a TypeScript SDK for web/Node integrations and a Kotlin SDK (generated contracts) for the PulseVault Android app. Both are generated from the OpenAPI spec to stay in sync with the API.
import { PatientPulseClient } from '@patientpulse/sdk'; // Initialize client const client = new PatientPulseClient({ apiKey: process.env.PP_API_KEY, baseUrl: 'https://api.patientpulse.in', env: 'production', }); // Request OTP for patient login const otpRes = await client.auth.requestOtp({ phone: '+919876543210', channel: 'sms', }); // Verify OTP and get session const session = await client.auth.verifyOtp({ phone: '+919876543210', otp: '123456', }); // Book an appointment const appointment = await client.appointments.book({ patientId: session.user.id, doctorId: 'doc_xyz', slotId: 'slot_abc', visitType: 'opd', }); // Interpret a lab report with AI const result = await client.ai.interpretLabReport({ recordId: 'rec_lab_001', patientId: session.user.id, includeHistory: true, }); console.log(result.interpretation.summary); // → "HbA1c elevated at 7.8% — borderline diabetic range." // Export patient as FHIR R4 bundle const fhirBundle = await client.interop.exportFhirR4(session.user.id); console.log(fhirBundle.resourceType); // → "Bundle"
OTP, Google OAuth, SSO, MFA, session management
Book, reschedule, cancel, availability slots
Profiles, records, check-in, uploads
Lab interpretation, ambient scribe, forecasting
FHIR R4, ABDM linking, PHR push/pull
Claims, NHCX submission, payer rules
Razorpay orders, verification, receipts
Benchmarks, operational insights, command center
Data contracts, patient snapshots, consent
Platform provisioning, org onboarding, governance
The TypeScript SDK does not yet exist as a published package. See the Codex Prompts section below for the exact prompt to generate it from the OpenAPI spec.
// Hilt-provided via core:network module class VaultRepository @Inject constructor( private val api: PulseVaultApi, private val db: VaultDatabase, ) { suspend fun getVault(profileId: String): VaultScreen { return api.getVault(profileId) } suspend fun uploadRecord( profileId: String, file: MultipartBody.Part, ): HealthRecord { val session = api.initiateUpload(profileId) // Upload to object storage, then complete return api.completeUpload(session.uploadSessionId) } suspend fun startAiExtraction( profileId: String, recordId: String, ): ExtractionJob { return api.createExtractionJob(profileId, recordId) } } // In your Composable screen: val vault by viewModel.vaultState.collectAsState() VaultScreen(vault = vault)
Kotlin data classes — all API request/response contracts
Retrofit interfaces + OkHttp client + generated SDK
Room entities for offline-first persistence
Repository pattern + sync orchestration
EncryptedSharedPreferences session storage
Shared Compose design system components
To read wearable data (steps, heart rate, sleep), declare android.permission.health.READ_STEPS etc. in AndroidManifest.xml and request runtime permissions before calling Health Connect APIs.
The following are ready-to-use prompts you can run in Codex / Claude to extend the SDK or add missing pieces — without touching the core repos.
Creates the publishable @patientpulse/sdk npm package from the OpenAPI 3.0 spec exported from PatientPulse.
Generate a TypeScript SDK package (@patientpulse/sdk) from the PatientPulse OpenAPI 3.0 specification located at /backend/app/main_monolith.py (FastAPI auto-generates the spec at /openapi.json). Requirements: - Use openapi-typescript-codegen or similar tool - Output to packages/typescript-sdk/src/ - Export a PatientPulseClient class with typed sub-clients for each domain: auth, appointments, patients, ai, interop, insurance, payments, analytics, bureau - All methods should be async and return typed response objects - Include error handling with typed PatientPulseError class - Add README.md with installation and quick-start examples - Target: ESM + CommonJS dual build via tsup - Include types for all 50+ Pydantic request/response schemas
Converts the existing packages/kotlin-sdk into a publishable Maven artifact.
Configure the existing Kotlin SDK at packages/kotlin-sdk to be publishable to Maven Central (or GitHub Packages as a first step). Requirements: - Add maven-publish plugin to build.gradle.kts - Group: in.patientpulse, artifactId: kotlin-sdk, version from git tag - Generate sources JAR and Javadoc JAR - Add signing configuration (use environment variables for CI) - Create GitHub Actions workflow: .github/workflows/publish-kotlin-sdk.yml that triggers on tag push (v*.*.*) - Update README with Gradle and Maven installation instructions
Adds real API key issuance, rotation, and scoping to the PatientPulse backend to power this developer portal.
Add a developer API key management system to the PatientPulse FastAPI backend.
New endpoints to add in a new route file backend/app/routes/developer_keys.py:
- POST /developer/keys — issue new API key (sandbox or production)
- GET /developer/keys — list all keys for authenticated developer
- DELETE /developer/keys/{key_id} — revoke a key
- POST /developer/keys/{key_id}/rotate — rotate a key
Schema requirements:
- ApiKey: id, prefix (first 8 chars), hashed_secret, environment (sandbox/production),
scopes (list), created_at, last_used_at, revoked_at
- Store only the SHA-256 hash of the secret; return plaintext only on creation
- Scopes: read:patients, write:appointments, read:claims, ai:interpret, interop:fhir
- Register routes in main_domains/ registry under a new 'developer' chunk
- Add middleware to validate pp_sandbox_sk_ and pp_live_sk_ key format on all /v2/ routesFastAPI already generates an OpenAPI spec — this prompt exposes it with proper versioning and auth bypass.
In backend/app/main_monolith.py, ensure the FastAPI OpenAPI spec is: 1. Accessible at GET /openapi.json without authentication 2. Versioned as "2.0.0" in the info block 3. Includes x-patientpulse-env tag on each endpoint (clinical, ai, interop, billing, admin) 4. Has proper security scheme defined: BearerAuth (HTTP bearer JWT) 5. Export a static copy to docs/openapi.json on app startup when APP_ENV=development using app.openapi() and json.dump() Also expose Swagger UI at /docs and ReDoc at /redoc (FastAPI does this by default — just confirm they are not disabled in production via DISABLE_DOCS env var check).