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

@modfolio/connect-sdk

v8.1.0

Published

Modfolio Connect SSO/OIDC SDK for ecosystem apps

Downloads

424

Readme

@modfolio/connect-sdk

Modfolio Connect SSO/OIDC SDK for ecosystem apps. v7.3.0.

Install

bun add @modfolio/connect-sdk

Published to public npm — no token or .npmrc needed. (A legacy GitHub Packages mirror still exists; using it requires @modfolio:registry=https://npm.pkg.github.com plus a GitHub Packages token, but new apps should use public npm.)

Quick Start (SvelteKit)

// src/lib/server/auth.ts
import { createSvelteKitAuth } from "@modfolio/connect-sdk/sveltekit";

export const auth = createSvelteKitAuth({
  clientId: "your-app-name",
});

// src/hooks.server.ts
import { auth } from "$lib/server/auth";
export const handle = auth.handle;

// src/routes/auth/login/+server.ts
export const GET = auth.loginHandler;

// src/routes/auth/callback/+server.ts
export const GET = auth.callbackHandler;

// src/routes/auth/logout/+server.ts
export const GET = auth.logoutHandler;

Adapters

| Framework | Import | Factory | |-----------|--------|---------| | SvelteKit 5 | @modfolio/connect-sdk/sveltekit | createSvelteKitAuth() | | Astro | @modfolio/connect-sdk/astro | createAstroAuth() | | SolidStart | @modfolio/connect-sdk/solidstart | createSolidStartAuth() | | Nuxt 3 | @modfolio/connect-sdk/nuxt | createNuxtAuth() | | Next.js | @modfolio/connect-sdk/nextjs | createNextAuth() (App + Pages Router) | | Qwik | @modfolio/connect-sdk/qwik | createQwikAuth() | | Hono (CF Workers) | @modfolio/connect-sdk/hono | createHonoAuth() |

Utility export paths: ./ssf (CAEP receiver) · ./dpop · ./fedcm · ./agent (MCP) · ./management · ./management-client.

Management API (PAT)

Programmatic app management with a Personal Access Token (mfp_…, issued at account.modfolio.io/developers/tokens). Two equivalent surfaces:

// Typed client — request/response types generated from the OpenAPI spec
import { createManagementClient } from "@modfolio/connect-sdk/management-client";

const connect = createManagementClient({ token: process.env.MODFOLIO_PAT! });
const { client_id } = await connect.createClient({
  name: "My App",
  redirect_uris: ["https://myapp.com/auth/callback"],
});

// Function helpers — same wire calls, handwritten types
import { registerApp, whoami } from "@modfolio/connect-sdk/management";

Methods: whoami · listClients · getClient · createClient · renameClient · deleteClient · addRedirectUri · removeRedirectUri · getScopes. Non-2xx responses throw ManagementError (.status, .code).

The types in src/generated/ are rendered from docs/openapi.json by bun run docs:openapi (repo root) and kept byte-fresh by the openapi:drift quality gate — never edit them by hand.

Defaults

| Config | Default | Purpose | |--------|---------|---------| | connectUrl | https://login.modfolio.io | OIDC API | | loginUrl | https://login.modfolio.io | Login UI redirect | | issuer | https://connect.modfolio.io | JWT issuer verification | | sessionCookie | mc_session | Session cookie name | | scope | openid profile email | OIDC scopes |

Flow

  1. App /auth/login redirects to https://login.modfolio.io/{clientId} with PKCE S256
  2. User authenticates on hosted login page
  3. Login redirects to app /auth/callback with code + state
  4. SDK exchanges code at POST /sso/token
  5. SDK verifies JWT (issuer: https://connect.modfolio.io) and sets session cookie

Full Guide

See docs/sdk-integration-guide.md for:

  • All 5 framework examples with complete route setup
  • ConnectUser type reference
  • Utility functions (MFA, org, tenant, ReBAC, webhooks)
  • Local dev port assignments (22 apps)
  • CF Pages build configuration

Upgrade notes: