{"_id":"@care-portals/patient-sdk","_rev":"10-8009670438ec3ad99495d3bb0a820f69","name":"@care-portals/patient-sdk","dist-tags":{"latest":"1.14.0"},"versions":{"1.12.1":{"name":"@care-portals/patient-sdk","version":"1.12.1","_id":"@care-portals/patient-sdk@1.12.1","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"dist":{"shasum":"74c49572c5fc1ce138617b92c3eabb23801a929a","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.12.1.tgz","fileCount":18,"integrity":"sha512-L2h4Ykp1JpIpWTY5szJyt8WrLqvMfFqvhzkZSTQ/FEsTlJbWjAauBeRSUCJfpMOJxVnmV1WtyHt0Odmnqs68uA==","signatures":[{"sig":"MEUCIQDpDHCkTKkb6xWDDc0Y1MnDkgrNJNQ+GzV5EDl4oa72hgIgKoK+eiGdCqJdEZ+tnQ4OprAZ5tkp5cxDE8tp1l4pL4s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41933},"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"gitHead":"a110240c5628e33e2b7523d5acd39937fc1a2a41","_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"_npmVersion":"11.2.0","description":"CarePortal patient API SDK","directories":{},"_nodeVersion":"22.12.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/patient-sdk_1.12.1_1761769739222_0.25199455480357824","host":"s3://npm-registry-packages-npm-production"}},"1.12.2":{"name":"@care-portals/patient-sdk","version":"1.12.2","_id":"@care-portals/patient-sdk@1.12.2","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"dist":{"shasum":"dc3702817647c49416bfb391621672687bda8be2","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.12.2.tgz","fileCount":18,"integrity":"sha512-Nut9jb9tyqa0QwF97LPn35FOaAVJe1m9A86g1tt66yHZ8BiaFoUMgGZ0+3XnX/EZjBPCLCbPBcIhTD1FE/Ul1Q==","signatures":[{"sig":"MEUCIC6uywGG8kM31/IHgnmA7Io2m4RPVsiEgGOUac2/HdkzAiEAvG9g3P7xXt3aytODn76yUx8Y4fC7uGY5Ywoql/YqhIU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39934},"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"gitHead":"a110240c5628e33e2b7523d5acd39937fc1a2a41","_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"_npmVersion":"11.2.0","description":"CarePortal patient API SDK","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@care-portals/api-interfaces":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/patient-sdk_1.12.2_1761847874839_0.30489950316283343","host":"s3://npm-registry-packages-npm-production"}},"1.12.3":{"name":"@care-portals/patient-sdk","version":"1.12.3","_id":"@care-portals/patient-sdk@1.12.3","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"dist":{"shasum":"567516b5f734b1314b96c308c5999502e6370383","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.12.3.tgz","fileCount":18,"integrity":"sha512-DcDdXtW3zuXSnF9bIHmJQtqs9jrpvf0vZRfGpAuKl4ZyxDqu1eaLo8RdK1LNj0Eme30hj4ogNhb6QdzK2FJbQg==","signatures":[{"sig":"MEYCIQDXglJIIvS7+VTigz2MWOnXgNGC4UpBJAcp26BBXV2XngIhAONgfaFmL9KeDfhZr7g5htqea3SV68xox407pVRB63vv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39934},"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"gitHead":"b60a8f1f9d7ffb60537608823639eb3e493f5f78","_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"_npmVersion":"11.2.0","description":"CarePortal patient API SDK","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@care-portals/api-interfaces":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/patient-sdk_1.12.3_1762790847184_0.45034615369048425","host":"s3://npm-registry-packages-npm-production"}},"1.12.4":{"name":"@care-portals/patient-sdk","version":"1.12.4","_id":"@care-portals/patient-sdk@1.12.4","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"dist":{"shasum":"3e9fb5df853b142e6336e8b8c32dbb0689b6c9c7","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.12.4.tgz","fileCount":18,"integrity":"sha512-J3HcmohkF6ydnFi+ibmz3RdSjdOWXiG4hJf6iV193iuOW6IC5te+56x4n37Gr2ml3CjcS9qn8N5z1ElnZSYmKQ==","signatures":[{"sig":"MEUCIQCrIIGcnm0mEk0TRTV/OqCcWNeHbDcB6a/qix1AjPpnywIgISSFNeCOFOO8FUuD4qQGYfOtEKH8TXysRK56N16yyrY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42613},"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"gitHead":"8b436336190420862096857e410a578590295211","_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"_npmVersion":"11.2.0","description":"CarePortal patient API SDK","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@care-portals/api-interfaces":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/patient-sdk_1.12.4_1763056776059_0.8534701669541407","host":"s3://npm-registry-packages-npm-production"}},"1.13.0":{"name":"@care-portals/patient-sdk","version":"1.13.0","_id":"@care-portals/patient-sdk@1.13.0","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"dist":{"shasum":"67da31bccc8ea1a338254bca95c00e2f924d88e3","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.13.0.tgz","fileCount":18,"integrity":"sha512-uMlZOdZfxWk7p/XF63mORKOhNCEi41mW66z0Tkha8zM+F1TV/UB1Zod59ZILUbxiBTcL6dyYybJSdv0M3jOTRQ==","signatures":[{"sig":"MEUCICJg9e1bxvhePYxept3e/sFqHB4HQ1+IFmBLWm6jxo7gAiEAsRfZpcUyNmbpbolgrAwETyssw+zu9qb7u4LLmCEwL3U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42939},"main":"./index.js","types":"./index.d.ts","exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"gitHead":"0f32bcc3e72b94e370cca0fb195add815d19c2ba","_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"_npmVersion":"11.2.0","description":"CarePortal patient API SDK","directories":{},"_nodeVersion":"22.12.0","dependencies":{"@care-portals/api-interfaces":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/patient-sdk_1.13.0_1765941525496_0.7409429592978134","host":"s3://npm-registry-packages-npm-production"}},"1.14.0":{"name":"@care-portals/patient-sdk","version":"1.14.0","description":"CarePortal patient API SDK","main":"./index.js","types":"./index.d.ts","publishConfig":{"access":"public"},"exports":{".":{"import":"./index.js","require":"./index.js"},"./*":{"import":"./*.js","require":"./*.js"}},"dependencies":{},"gitHead":"3b139951baea84e0603302d3369c5abc05bb13ca","_id":"@care-portals/patient-sdk@1.14.0","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-Ct4xeDMcqvwurih1/Qf9Rj6GtJ1/hIC0Sj6TS3+HpBbqR0KcwQFTfaGAYEiMYT263FOME1uGtN5nteKXkiUc0A==","shasum":"a7b4aa9157b99115ce357ad9f38a010363eafc0d","tarball":"https://registry.npmjs.org/@care-portals/patient-sdk/-/patient-sdk-1.14.0.tgz","fileCount":18,"unpackedSize":48790,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC3WyWO3dTdz7U7FDKX1YjxORZvyp7crfQSHgS9aQPCHQIhAPs9U+zLMWxDtwaAG/P3BmetSbGES1USX88g4pEWr1/b"}]},"_npmUser":{"name":"appgen","email":"abdullah@appgen.ca"},"directories":{},"maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/patient-sdk_1.14.0_1789153212992_0.5675832014905375"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-29T20:28:59.120Z","modified":"2026-09-11T19:00:13.421Z","1.0.0":"2025-10-29T20:14:18.371Z","1.12.0":"2025-10-29T20:20:05.919Z","1.12.1":"2025-10-29T20:28:59.416Z","1.12.2":"2025-10-30T18:11:15.032Z","1.12.3":"2025-11-10T16:07:27.364Z","1.12.4":"2025-11-13T17:59:36.266Z","1.13.0":"2025-12-17T03:18:45.655Z","1.14.0":"2026-09-11T19:00:13.190Z"},"description":"CarePortal patient API SDK","maintainers":[{"name":"appgen","email":"abdullah@appgen.ca"}],"readme":"# @care-portals/patient-sdk\r\n\r\nA TypeScript SDK for interacting with the CarePortal Patient API.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @care-portals/patient-sdk\r\n```\r\n\r\nThe package has no runtime dependencies. Every type it uses is exported from the\r\npackage itself, so there is nothing else to install:\r\n\r\n```typescript\r\nimport { PatientApi, type IOrder, type IWeightLog } from '@care-portals/patient-sdk';\r\n```\r\n\r\n## Usage\r\n\r\n```typescript\r\nimport { PatientApi } from '@care-portals/patient-sdk';\r\n\r\n// Initialize the client\r\nconst client = new PatientApi({\r\n  organization: 'your-organization-id',\r\n  baseUrl: 'url to api instance', // optional, defaults to https://patient-api.portals.care and can be used to point to other envionments\r\n  token: 'your-auth-token' // Optional, can be set later\r\n});\r\n\r\n// Set token if not provided during initialization\r\nclient.setToken('your-auth-token');\r\n\r\n// Use the client\r\nconst profile = await client.customer.profile.get();\r\nconst orders = await client.orders.list('cart-id');\r\nconst subscriptions = await client.subscriptions.list();\r\n```\r\n\r\n## API Reference\r\n\r\n### Authentication\r\n\r\n- `client.setToken(token: string)` - Set the authentication token\r\n\r\n### Customer Management\r\n\r\n- `client.customer.profile.get()` - Get customer profile\r\n- `client.customer.profile.update(data)` - Update customer profile\r\n- `client.customer.account.get()` - Get account information\r\n- `client.customer.addresses.list()` - List customer addresses\r\n- `client.customer.addresses.updateDefault(data)` - Update default address\r\n- `client.customer.password.update(currentPassword, newPassword)` - Update password\r\n- `client.customer.requirements.list()` - Get account requirements\r\n- `client.customer.persona.getStatus()` - Get persona verification status\r\n- `client.customer.persona.getLink(redirectUri)` - Get persona verification link\r\n- `client.customer.paymentMethods.list()` - List payment methods\r\n- `client.customer.ids.upload(files)` - Upload ID documents\r\n- `client.customer.email.check(email, origin)` - Check email availability\r\n\r\n### Orders\r\n\r\n- `client.orders.retrieve(orderId)` - Get order details\r\n- `client.orders.list(cartId)` - List orders for a cart\r\n- `client.orders.payments.create(orderId, paymentMethodId, returnUrl)` - Create payment\r\n- `client.orders.payments.confirm(orderId)` - Confirm payment\r\n- `client.orders.prescriptions.list(orderId)` - List prescriptions for an order\r\n- `client.orders.shippingAddress.update(orderId, address)` - Update shipping address\r\n\r\n### Checkout\r\n\r\n- `client.checkout.start(cartId)` - Start checkout process\r\n- `client.checkout.session.retrieve(cartId, couponCode?)` - Get checkout session\r\n- `client.checkout.payments.create(cartId, paymentData)` - Create checkout payment\r\n- `client.checkout.payments.confirm(cartId)` - Confirm checkout payment\r\n\r\n### Subscriptions\r\n\r\n- `client.subscriptions.list()` - List subscriptions\r\n- `client.subscriptions.retrieve(id, populate?)` - Get subscription details\r\n- `client.subscriptions.cancel(id)` - Cancel subscription\r\n- `client.subscriptions.update(id, data)` - Update subscription\r\n- `client.subscriptions.history.list(id)` - Get subscription history\r\n- `client.subscriptions.renewal.skip(id)` - Skip renewal\r\n- `client.subscriptions.renewal.renew(id)` - Renew subscription\r\n- `client.subscriptions.billing.getPortalLink()` - Get billing portal link\r\n\r\n### Messages\r\n\r\n- `client.messages.list(params?)` - List messages\r\n- `client.messages.retrieve(id)` - Get message details\r\n- `client.messages.reply(inboundDto)` - Reply to message\r\n\r\n### Files\r\n\r\n- `client.files.retrieve(fileName)` - Get file details\r\n- `client.files.upload(files)` - Upload multiple files\r\n- `client.files.uploadSingle(file)` - Upload single file\r\n\r\n### Logs\r\n\r\n- `client.logs.all(params?)` - Get all logs (weight + injections combined, sorted by date)\r\n- `client.logs.recentActivity(params?)` - Get recent activity (limited list of recent logs)\r\n- `client.logs.weight.list(params?)` - List weight logs\r\n- `client.logs.weight.create(data)` - Create weight log\r\n- `client.logs.weight.update(id, data)` - Update weight log\r\n- `client.logs.weight.delete(id)` - Delete weight log\r\n- `client.logs.injections.list(params?)` - List injection logs\r\n- `client.logs.injections.create(data)` - Create injection log\r\n- `client.logs.injections.update(id, data)` - Update injection log\r\n- `client.logs.injections.delete(id)` - Delete injection log\r\n\r\n### Purchases\r\n\r\n- `client.purchases.list()` - List purchases\r\n- `client.purchases.retrieve(orderId, purchaseId)` - Get purchase details\r\n- `client.purchases.history.list(id)` - Get purchase history\r\n\r\n### Authentication\r\n\r\n- `client.auth.login(username, password)` - Login\r\n- `client.auth.password.requestReset(email)` - Request password reset\r\n- `client.auth.password.validateResetToken(token)` - Validate reset token\r\n- `client.auth.password.reset(token, password)` - Reset password\r\n- `client.auth.signup(user)` - Sign up new user\r\n\r\n## Types\r\n\r\nThe SDK includes comprehensive TypeScript types for all API responses and request parameters. All types are exported from the main package.\r\n\r\n## Error Handling\r\n\r\nThe SDK throws errors for HTTP errors and network issues. Error objects include:\r\n\r\n- `status`: HTTP status code (0 for network errors)\r\n- `data`: Error response data\r\n- `method`: HTTP method\r\n- `url`: Request URL\r\n- `body`: Request body\r\n- `params`: Query parameters\r\n- `headers`: Request headers\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}