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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eka-care/medical-records-ui

v1.0.25

Published

Framework-agnostic React SDK for the Eka Care Medical Records feature. Drop it into any React app (Next.js, Vite, Electron) to get a full records list, filters, upload flow, and document preview.

Readme

@eka-care/medical-records-ui

Framework-agnostic React SDK for the Eka Care Medical Records feature. Drop it into any React app (Next.js, Vite, Electron) to get a full records list, filters, upload flow, and document preview.

Installation

npm install @eka-care/medical-records-ui

Peer dependencies

Make sure these are installed in your host app:

npm install react react-dom zustand lucide-react

Setup

1. Import styles

In your app's entry point (e.g. _app.tsx, main.tsx):

import '@eka-care/medical-records-ui/styles';

2. Wrap with SdkProvider

import { SdkProvider } from '@eka-care/medical-records-ui';

<SdkProvider
  config={{ environment: 'prod' }}
  bid="YOUR_BID"
  patientId="YOUR_PATIENT_ID"
>
  {/* your app or the RecordsView */}
</SdkProvider>

If bid or patientId are not yet available (e.g. no patient selected), SdkProvider renders a placeholder automatically — no extra handling needed.

3. Render the records view

import { SdkProvider, RecordsView } from '@eka-care/medical-records-ui';

export function MedicalRecordsPanel({ bid, patientId }) {
  return (
    <SdkProvider
      config={{ environment: 'prod' }}
      bid={bid}
      patientId={patientId}
    >
      <RecordsView />
    </SdkProvider>
  );
}

SdkProvider props

| Prop | Type | Required | Description | |------|------|----------|-------------| | config | SdkConfig | Yes | SDK configuration (see below) | | bid | string | No | Business/clinic ID. Shows placeholder when absent. | | patientId | string | No | Patient ID. Shows placeholder when absent. | | documentTypes | DocumentTypeConfig[] | No | Document type labels from your onboarding config. Falls back to built-in labels. |

SdkConfig

| Field | Type | Description | |-------|------|-------------| | environment | 'prod' \| 'staging' | API environment | | baseUrl | string | Override the API base URL (useful for proxying) | | accessToken | string | Auth token. Not needed if using cookie-based auth. | | onUnauthorized | () => void | Called on 401 — use to refresh the token or redirect to login | | defaultHeaders | Record<string, string> | Extra headers added to every request |

RecordsView props

| Prop | Type | Description | |------|------|-------------| | allowUpload | boolean | Show/hide the upload button. Default: true | | attachedIds | string[] | Record IDs already attached to the current session context | | maxAttachable | number | Max records attachable at once | | onAttachToContext | (records) => void | Called when user adds a record to session context | | onRemoveAttachment | (documentId) => void | Called when user removes a record from context | | onCopyToNote | (text, anchor?) => void | Called when user copies a smart report to notes | | onToast | (message, type?) => void | Hook into the host app's toast/notification system |

Authentication

The SDK uses cookie-based auth automatically when running on the same domain as the Eka Care backend. For token-based auth pass accessToken in config and provide onUnauthorized to handle token refresh:

<SdkProvider
  config={{
    environment: 'prod',
    accessToken: yourToken,
    onUnauthorized: refreshToken,
  }}
  bid={bid}
  patientId={patientId}
>

PDF support

No setup required. PDF preview works out of the box — the SDK loads the pdfjs worker from CDN automatically.

Next.js

Works without any extra webpack config. react-pdf and pdfjs-dist are peer dependencies — install them in your app:

npm install react-pdf pdfjs-dist

Development

# Start the dev playground at https://test.1.eka.care:4443
npm run dev

# Build the SDK
npm run build

# Run tests
npm test

Dev playground setup

The playground runs on https://test.1.eka.care:4443 so auth cookies from the Eka Care backend are available.

  1. Add to /etc/hosts:

    127.0.0.1  test.1.eka.care
  2. Generate a local certificate:

    cd certificates && mkcert test.1.eka.care
  3. Log into the Eka Care app on test.1.eka.care so the auth cookie is set.

  4. Run npm run dev and open https://test.1.eka.care:4443.