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

@bpmn-sdk/profiles

v0.0.5

Published

Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server

Downloads

365

Readme

npm license typescript

Documentation · GitHub · Changelog


Overview

@bpmn-sdk/profiles is the shared layer that connects the casen CLI with the local proxy server. It handles profile CRUD (read/write to ~/.config/casen/config.json), creates typed CamundaClient instances from stored profiles, and resolves Authorization headers for any supported auth type.

You do not need this package if you are connecting directly to Camunda using @bpmn-sdk/api. It is intended for tooling that needs to share authentication state with the CLI.

Features

  • Profile CRUD — list, get, save, delete, and activate named profiles stored in ~/.config/casen/config.json
  • Client factorycreateClientFromProfile(name?) creates a ready-to-use CamundaClient from the active or named profile
  • Auth header resolutiongetAuthHeader(config) returns the correct Authorization header string for Bearer, Basic, and OAuth2 auth types
  • OAuth2 token caching — tokens are cached in memory and refreshed 60 seconds before expiry; no extra files written
  • XDG-aware — profile file path resolves to the correct platform directory (Linux XDG, macOS, Windows AppData)
  • Zero UI dependencies — no TUI or CLI dependencies; plain Node.js

Installation

npm install @bpmn-sdk/profiles

Quick Start

Create a CamundaClient from the active profile

import { createClientFromProfile } from "@bpmn-sdk/profiles"

// Uses the currently active profile from ~/.config/casen/config.json
const client = createClientFromProfile()

const instances = await client.processInstance.searchProcessInstances({})
console.log(instances.page.totalItems)

Use a named profile

const client = createClientFromProfile("production")

Resolve an auth header directly

import { getActiveProfile, getAuthHeader } from "@bpmn-sdk/profiles"

const profile = getActiveProfile()
if (profile) {
  const header = await getAuthHeader(profile.config)
  // "Bearer eyJ..." or "Basic dXNlcjpwYXNz" or ""
}

Manage profiles programmatically

import { listProfiles, saveProfile, useProfile, deleteProfile } from "@bpmn-sdk/profiles"

// List all profiles
const profiles = listProfiles()

// Save a new profile
saveProfile({
  name: "local",
  apiType: "self-managed",
  config: {
    baseUrl: "http://localhost:8080/v2",
    auth: { type: "basic", username: "admin", password: "admin" },
  },
})

// Activate a profile
useProfile("local")

// Delete a profile
deleteProfile("old-profile")

API Reference

Profile Management

| Export | Description | |--------|-------------| | listProfiles() | Returns all stored profiles | | getProfile(name) | Returns a profile by name, or undefined | | getActiveProfile() | Returns the currently active profile | | getActiveName() | Returns the active profile name | | saveProfile(profile) | Create or update a profile | | deleteProfile(name) | Remove a profile | | useProfile(name) | Set the active profile | | getConfigFilePath() | Returns the full path to the config file |

Client Factories

| Export | Description | |--------|-------------| | createClientFromProfile(name?) | CamundaClient from the active or named profile | | createAdminClientFromProfile(name?) | AdminApiClient from the active or named profile |

Auth

| Export | Description | |--------|-------------| | getAuthHeader(config) | Resolves an Authorization header string for any auth type |


Related Packages

| Package | Description | |---------|-------------| | @bpmn-sdk/core | BPMN/DMN/Form parser, builder, layout engine | | @bpmn-sdk/canvas | Zero-dependency SVG BPMN viewer | | @bpmn-sdk/editor | Full-featured interactive BPMN editor | | @bpmn-sdk/engine | Lightweight BPMN process execution engine | | @bpmn-sdk/feel | FEEL expression language parser & evaluator | | @bpmn-sdk/plugins | 22 composable canvas plugins | | @bpmn-sdk/api | Camunda 8 REST API TypeScript client | | @bpmn-sdk/ascii | Render BPMN diagrams as Unicode ASCII art | | @bpmn-sdk/operate | Monitoring & operations frontend for Camunda clusters |

License

MIT © bpmn-sdk