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

talon-auth-nuxt

v0.14.0

Published

Nuxt module for integrating [Talon](https://talon.codes) authentication into your Nuxt application.

Readme

talon-auth-nuxt

Nuxt module for integrating Talon authentication into your Nuxt application.

Installation

pnpm add talon-auth-nuxt talon-auth

Setup

1. Register the module

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['talon-auth-nuxt'],

  talon: {
    appId: process.env.TALON_APP_ID,
    apiUrl: process.env.API_URL // defaults to https://api.talon.codes
  }
})

2. Add the login component to your page

<script setup lang="ts">
// Import the talon-auth login web component (client-side only)
if (import.meta.client) {
  await import('talon-auth/login')
}

const config = useRuntimeConfig()
const { appId, apiUrl } = config.public.talon!
const user = useTalonUser()

onMounted(() => setupTalonLogin())
</script>

<template>
  <talon-login :app-id="appId" :api-url="apiUrl" @login="onLogin" />

  <div v-if="user">
    Welcome, {{ user.email }}
    <button @click="logout">Logout</button>
  </div>
</template>

Configuration

| Option | Type | Default | Description | | -------------------- | -------- | ------------------------- | ------------------------------------- | | appId | string | required | Your Talon application ID | | apiUrl | string | https://api.talon.codes | Talon API URL | | authEndpoint | string | /api/auth | Server endpoint for cookie management | | loginComponentName | string | talon-login | Custom element tag name | | cookie | object | see below | Cookie configuration |

Cookie Configuration

cookie: {
  name: 'talon_auth',      // Cookie name
  httpOnly: true,          // HTTP-only cookie
  secure: true,            // Secure in production
  sameSite: 'lax',         // SameSite policy
  maxAge: 60 * 60 * 24 * 7, // 7 days
  path: '/'                // Cookie path
}

Composables

The module auto-imports the following composables:

useTalonUser()

Returns a readonly ref of the current authenticated user.

const user = useTalonUser()
// user.value is TalonAuthUser | null

useTalonLogout()

Returns a logout function that clears the session.

const logout = useTalonLogout()
await logout()

setupTalonLogin()

Call this in onMounted to initialize the login flow and sync authentication state.

onMounted(() => setupTalonLogin())

getLoginEl()

Returns the <talon-login> DOM element. Useful for accessing the component's methods directly.

const loginEl = getLoginEl()
const token = await loginEl.getAccessToken()

How It Works

  1. Server-side: On each request, the module's server plugin verifies the auth cookie and populates the user state for SSR.

  2. Client-side: When setupTalonLogin() is called, it syncs with the <talon-login> component and updates the server cookie.

  3. Cookie management: The module registers server handlers at the configured authEndpoint:

    • POST /api/auth - Verifies token and sets the auth cookie
    • DELETE /api/auth - Clears the auth cookie

TypeScript

The module exports types from talon-auth:

import type { TalonAuthUser, TalonLoginComponent } from 'talon-auth-nuxt'