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

@kaigilb/twinpod-auth

v1.0.1

Published

Solid-OIDC authentication composable for Vue 3 apps connecting to a TwinPod server.

Readme

@kaigilb/twinpod-auth

Solid-OIDC authentication composable for Vue 3 apps connecting to a TwinPod server.

Handles login, logout, and OIDC redirect processing via @inrupt/solid-client-authn-browser.


Install

npm install @kaigilb/twinpod-auth

Requires a .npmrc pointing @kaigilb at GitHub Packages:

@kaigilb:registry=https://npm.pkg.github.com

Public API

useTwinPodAuth(options?)

import { useTwinPodAuth } from '@kaigilb/twinpod-auth'

const {
  isLoggedIn,     // Ref<boolean>  — true when an active session exists
  webId,          // Ref<string|null>  — the authenticated user's WebID URI
  loading,        // Ref<boolean>  — true while any auth operation is in progress
  error,          // Ref<{type, message}|null>  — set when any operation fails
  session,        // Session object — use session.fetch as a DPoP-aware fetch replacement
  handleRedirect, // () => Promise<void>  — call once on every page load
  login,          // (oidcIssuer, redirectUrl?) => Promise<void>
  logout          // () => Promise<void>
} = useTwinPodAuth({ clientName: 'MyApp' })

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | clientName | string | 'NoteWorld' | App name shown in the OIDC consent screen | | _sessionOverride | object\|null | null | Inject a mock Session in tests |


Usage

1. Wrap your app (App.vue)

Call useTwinPodAuth once at the app root. Provide auth and twinpodFetch to all child components.

<script setup>
import { provide, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { useTwinPodAuth } from '@kaigilb/twinpod-auth'

const router = useRouter()
const route = useRoute()

const { isLoggedIn, webId, loading, error, session, handleRedirect, login, logout } =
  useTwinPodAuth({ clientName: 'MyApp' })

// Provide DPoP-aware fetch for child composables that read/write TwinPod data
provide('twinpodFetch', (url, options) => session.fetch(url, options))
provide('auth', { isLoggedIn, webId, loading, error, login, logout })

onMounted(async () => {
  await handleRedirect()
  if (isLoggedIn.value && route.path === '/login') router.push('/')
  else if (!isLoggedIn.value && route.path !== '/login') router.push('/login')
})
</script>

2. Login view

<script setup>
import { inject } from 'vue'
const { login, loading, error } = inject('auth')
</script>

<template>
  <button @click="login(import.meta.env.VITE_TWINPOD_URL)" :disabled="loading">
    Connect to TwinPod
  </button>
</template>

3. TwinPod data composables

const twinpodFetch = inject('twinpodFetch')
const response = await twinpodFetch(podUrl)  // DPoP auth headers added automatically

Environment variable

Set VITE_TWINPOD_URL in your .env.local to the TwinPod OIDC issuer URL:

VITE_TWINPOD_URL=https://tst-first.demo.systemtwin.com/i

Spec

/Users/kaigilb/Vault_Ideas/5 - Project/NoteWorld/NoteWorld.md