npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@care-portals/patient-sdk

v1.13.0

Published

CarePortal patient API SDK

Readme

@care-portals/patient-sdk

A TypeScript SDK for interacting with the CarePortal Patient API.

Installation

npm install @care-portals/patient-sdk

Usage

import { createPatientApiClient } from '@care-portals/patient-sdk';

// Initialize the client
const client = new PatientApi({
  organization: 'your-organization-id',
  baseUrl: 'url to api instance'  // optional, defaults to https://patient-api.portals.care and can be used to point to other envionments
  token: 'your-auth-token' // Optional, can be set later
});

// Set token if not provided during initialization
client.setToken('your-auth-token');

// Use the client
const profile = await client.customer.profile.get();
const orders = await client.orders.list('cart-id');
const subscriptions = await client.subscriptions.list();

API Reference

Authentication

  • client.setToken(token: string) - Set the authentication token

Customer Management

  • client.customer.profile.get() - Get customer profile
  • client.customer.profile.update(data) - Update customer profile
  • client.customer.account.get() - Get account information
  • client.customer.addresses.list() - List customer addresses
  • client.customer.addresses.updateDefault(data) - Update default address
  • client.customer.password.update(currentPassword, newPassword) - Update password
  • client.customer.requirements.list() - Get account requirements
  • client.customer.persona.getStatus() - Get persona verification status
  • client.customer.persona.getLink(redirectUri) - Get persona verification link
  • client.customer.paymentMethods.list() - List payment methods
  • client.customer.ids.upload(files) - Upload ID documents
  • client.customer.email.check(email, origin) - Check email availability

Orders

  • client.orders.retrieve(orderId) - Get order details
  • client.orders.list(cartId) - List orders for a cart
  • client.orders.payments.create(orderId, paymentMethodId, returnUrl) - Create payment
  • client.orders.payments.confirm(orderId) - Confirm payment
  • client.orders.prescriptions.list(orderId) - List prescriptions for an order
  • client.orders.shippingAddress.update(orderId, address) - Update shipping address

Checkout

  • client.checkout.start(cartId) - Start checkout process
  • client.checkout.session.retrieve(cartId, couponCode?) - Get checkout session
  • client.checkout.payments.create(cartId, paymentData) - Create checkout payment
  • client.checkout.payments.confirm(cartId) - Confirm checkout payment

Subscriptions

  • client.subscriptions.list() - List subscriptions
  • client.subscriptions.retrieve(id, populate?) - Get subscription details
  • client.subscriptions.cancel(id) - Cancel subscription
  • client.subscriptions.update(id, data) - Update subscription
  • client.subscriptions.history.list(id) - Get subscription history
  • client.subscriptions.renewal.skip(id) - Skip renewal
  • client.subscriptions.renewal.renew(id) - Renew subscription
  • client.subscriptions.billing.getPortalLink() - Get billing portal link

Messages

  • client.messages.list(params?) - List messages
  • client.messages.retrieve(id) - Get message details
  • client.messages.reply(inboundDto) - Reply to message

Files

  • client.files.retrieve(fileName) - Get file details
  • client.files.upload(files) - Upload multiple files
  • client.files.uploadSingle(file) - Upload single file

Logs

  • client.logs.all(params?) - Get all logs (weight + injections combined, sorted by date)
  • client.logs.recentActivity(params?) - Get recent activity (limited list of recent logs)
  • client.logs.weight.list(params?) - List weight logs
  • client.logs.weight.create(data) - Create weight log
  • client.logs.weight.update(id, data) - Update weight log
  • client.logs.weight.delete(id) - Delete weight log
  • client.logs.injections.list(params?) - List injection logs
  • client.logs.injections.create(data) - Create injection log
  • client.logs.injections.update(id, data) - Update injection log
  • client.logs.injections.delete(id) - Delete injection log

Purchases

  • client.purchases.list() - List purchases
  • client.purchases.retrieve(orderId, purchaseId) - Get purchase details
  • client.purchases.history.list(id) - Get purchase history

Authentication

  • client.auth.login(username, password) - Login
  • client.auth.password.requestReset(email) - Request password reset
  • client.auth.password.validateResetToken(token) - Validate reset token
  • client.auth.password.reset(token, password) - Reset password
  • client.auth.signup(user) - Sign up new user

Types

The SDK includes comprehensive TypeScript types for all API responses and request parameters. All types are exported from the main package.

Error Handling

The SDK throws errors for HTTP errors and network issues. Error objects include:

  • status: HTTP status code (0 for network errors)
  • data: Error response data
  • method: HTTP method
  • url: Request URL
  • body: Request body
  • params: Query parameters
  • headers: Request headers

License

MIT