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

tscim

v0.0.1

Published

A TypeScript implementation of the SCIM protocol

Readme

tscim - A Typescript library for implementing the SCIM protocol

tscim is a library that implements the core SCIM protocol, with hooks (called "adapters") for wiring up your own User and (optional) Group data stores. tscim handles some of the trickier parts of the SCIM protocol, in particular filtering and patching. Some demo applications are included to show the library used in action.

SCIM RFCs:

  • Core Schema: https://datatracker.ietf.org/doc/html/rfc7643
  • Protocol: https://datatracker.ietf.org/doc/html/rfc7644

Setup

<TODO: show how to install from npm>

See examples below for how to import the various classes and types, depending on what you are trying to build.

Examples

Example: Expose your domain model as SCIM

In order to expose Users and (optionally) Groups, you must first implement the ResourceAdapter<TResource> interface for each type. Once these are implemented you can pass them into a new instance of the ScimService class.

// TODO

Example: Interact with a remote SCIM server

A class ScimClient is provided that allows an application to interact with a remote SCIM server.

// TODO

Example: Synchronize data

tscim includes some helper functions showing how to synchronize data across SCIM servers. Generally you would have this point to a remote ScimClient and local ScimService, but there's nothing stopping you from using two ScimClient or two ScimService instances.

// TODO

Demo Applications

tscim does not directly include any utilities for adding SCIM API routes to your application, as there are any number of existing or home-grown HTTP frameworks. Instead we include a set of demo applications in the repository which show what is involved in integrating into your own application.

Two demo applications are included in tscim, to both show examples of how to wire up tscim to multiple frameworks as well as how to synchronize data across SCIM applications. It is recommended to run both applications together to see an example of the SCIM protocol in use between a client and server application.

To run, first make sure to build the tscim package via pnpm build. Then, in separate terminal windows cd to the demo applications and run pnpm start:dev.

Express demo

The application in demo/express shows how to wrap the tscim services to offer the SCIM API in a relatively simple Express.js application. Initial fake data is added to make it easier to get going, particularly when also runnning the Nest.js application which uses the Express application as a SCIM server. The Express app uses the SCIM data model directly, storing data in the in-memory resource adapter.

Nest demo

The Nest.js application in demo/nest is a more complicated example. The Nest application shows how to integrate tscim into an application with its own domain model backed by real storage (SQLite and Loki). The Nest application also shows an example how to synchronize data, using the Express application as the SCIM server.

Architecture

The tscim library is broken into 3 main sections:

  • scim: The core SCIM API types (API, models, filter and patch DSLs, errors, etc)
  • app: The application layer types (HTTP clients, SCIM adapters, services, etc)
  • parser: A simple general purpose combinator parser, primarily used by the SCIM filtering DSL. Heavily inspired by Claudiu Ivan's A Principled Approach to Querying Data blog.

Every object in the SCIM data model exists as an interface.

The SCIM API is modeled as a set of nested interfaces:

  • ScimApi: the root interface
    • ResourcesApi: the parent interface for interacting with SCIM resources (Users and Groups)
      • ResourceApi<T extends Resource>: a generic interface for managing a resource type
      • BulkOperationsApi: interface for generic bulk management of multiple resources
    • ConfigApi: the parent interface for interacting with the SCIM configuration endpoints
      • ResourceTypeApi: the resource types configuration API interface
      • ServiceProvicer: the service providers configuration API interface
      • Schemas: the schemas configuration API

To implement a SCIM server on top of your data model you will create a new instance of the ScimService class, as well as implement your own subclass of ResourceAdapter for Users and optionally Groups.

To interace with a remote SCIM service, you can create an instance of the ScimClient class.

Note that both the ScimService and ScimClient implement the same ScimApi interface.

Contributing

The pnpm package manager is used for development, as well as Vitest for the main unit tests.

Building

To build the library, run the pnpm build script in the root directly.

Running the tests

Tests are included in the main tscim library, as well as in some of the demo applications. All of them will use the same command to run:


# Run all tests
pnpm test

# Run a single test
pnpm test filter-dsl.test

# Run all tests and watch
pnpn test-watch

Type checking and linting

tscim and all demo applications include a typecheck command

# Run Typescript type checks
pnpm check

tscim and some demo applications include linting via eslint, which can also be run with typechecking

# Run linter
pnpm lint

# Run linter in fix mode
pnpm lint-fix

# type check and lint
pnpm lint-check