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

@vch-lt/path

v0.1.3

Published

TypeScript SDK for integrating custom course websites with Path patient tracking software (VCH)

Downloads

267

Readme

Path Learner API SDK

A fully typesafe TypeScript SDK for integrating custom course websites with Path, the patient education tracking hub used by Vancouver Coastal Health.

What is this SDK?

This SDK enables custom course websites to:

  • Authenticate learners through Path's authentication system
  • Track user progress on a per-learner, per-course basis
  • Submit progress updates when learners complete milestones
  • Retrieve enrollment data and historical progress records

One SDK instance per course - Each course website creates a single pathSDK instance configured with that course's ID. The SDK handles all communication with Path's backend to sync learner progress.

Use Case

VCH uses Path to track patient care training across multiple custom course websites. When a healthcare professional completes a training module on your custom course website, this SDK reports that progress back to Path's centralized tracking system. This allows VCH to monitor training compliance and progress across their entire organization.

Installation

npm install @vch-lt/path

Quick Start

import { pathSDK } from "@vch-lt/path";

// Create one SDK instance per course
// This connects your course website to Path's tracking system
const path = pathSDK({
  courseId: 1, // Your course's ID in Path
  courseUrl: "https://mycourse.com", // Your course website URL (for login redirects)
});

// Check authentication status
const authStatus = await path.checkAuth();
if (authStatus.isAuthenticated) {
  console.log("Logged in as:", authStatus.enrollment?.user.email);
}

// Get enrollment and progress
const enrollment = await path.getEnrollmentAndProgress();
console.log("Progress records:", enrollment.progress);

// Submit progress
await path.submitProgress(1, true);

API Reference

pathSDK(config)

Create a new Path API instance.

Parameters:

  • config.courseId (number, required) - The course ID in Path
  • config.pathUrl (string, optional) - Path backend URL (default: https://path.vchlearn.ca)
  • config.courseUrl (string, required) - Your course website URL for login redirects

Example:

const path = pathSDK({
  courseId: 1,
  pathUrl: "https://path.vchlearn.ca", // Usually you don't need to set this
  courseUrl: "https://mycourse.com",
});

Methods

path.checkAuth(): Promise<AuthStatus>

Check authentication status.

Returns:

{
  isAuthenticated: boolean;
  enrollment?: Enrollment;
}

Example:

const authStatus = await api.checkAuth();
if (authStatus.isAuthenticated) {
  console.log("User:", authStatus.enrollment?.user);
}

login(callbackUrl?: string): void

Redirect to login page.

Parameters:

  • callbackUrl (string, optional) - Override the default callback URL

Example:

api.login("https://example.com/after-login");

logout(): Promise<void>

Logout the current user.

Throws: Error if logout fails

Example:

try {
  await api.logout();
  console.log("Logged out successfully");
} catch (error) {
  console.error("Logout failed:", error.message);
}

getEnrollmentAndProgress(): Promise<Enrollment>

Get enrollment and progress data.

Returns:

{
  id: number;
  user: User;
  course: Course;
  progress?: Progress[];
}

Throws: Error if not authenticated or request fails

Example:

try {
  const enrollment = await api.getEnrollmentAndProgress();
  console.log("Course:", enrollment.course.title);
  console.log("Progress:", enrollment.progress);
} catch (error) {
  console.error("Failed to fetch:", error.message);
}

submitProgress(milestoneId: number, value: MilestoneValue): Promise<SubmitProgressResponse>

Submit progress for a milestone.

Parameters:

  • milestoneId (number) - The milestone ID
  • value (MilestoneValue) - The progress value (boolean, string, number, array, or object)

Returns:

{
  success: boolean;
  progress: Progress;
}

Throws: Error if submission fails

Example:

// Boolean value
await api.submitProgress(1, true);

// String value
await api.submitProgress(2, "Completed lesson 1");

// Number value
await api.submitProgress(3, 95);

// Array value
await api.submitProgress(4, ["item1", "item2"]);

// Object value
await api.submitProgress(5, { score: 95, completed: true });

Error Handling

All async methods may throw errors. Always wrap them in try-catch blocks:

try {
  await api.submitProgress(1, true);
} catch (error) {
  console.error("Submission failed:", error.message);
  // Handle error appropriately
}