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

nominee-supabase

v3.0.0

Published

Keeps provider tokens fresh at execution — without it, a paused agent resumes on the token that expired while a human approved.

Downloads

513

Readme

nominee-supabase

Supabase strategy for nominee — use Supabase as your store of provider tokens, and let nominee keep them fresh.

When a user signs in with a third-party provider, Supabase Auth hands you a provider_refresh_token once. You persist it (a row per user + provider). This strategy reads that row over PostgREST and, when the cached access token is missing or stale, refreshes it at the provider and writes the fresh one back. Zero dependencies — just fetch.

It proves the point of nominee: the agent code is identical to the Auth0 or OAuth2 path. Only the strategy line changes.

npm i nominee nominee-supabase
import { Nominee } from 'nominee'
import { Supabase } from 'nominee-supabase'

const nominee = new Nominee({
  strategy: Supabase({
    url: process.env.SUPABASE_URL!,
    key: process.env.SUPABASE_SERVICE_ROLE_KEY!, // server-side; or anon + RLS
    // refresh stored refresh tokens at the provider when they go stale:
    connections: {
      github: {
        tokenEndpoint: 'https://github.com/login/oauth/access_token',
        clientId: process.env.GITHUB_CLIENT_ID!,
        clientSecret: process.env.GITHUB_CLIENT_SECRET!,
      },
    },
  }),
})

// Decision-bound: credential resolved inside execute after capability consumption
await nominee.run(
  { tool: 'github.issue.close', input: { repo, issue }, user: 'alice', connection: 'github' },
  ({ token }) => closeIssue({ repo, issue, token }),
)

For dev and non-production use, standalone nominee.token() still works:

// identical to every other strategy — fresh token at call time
const token = await nominee.token({ user: 'alice', connection: 'github' })

The table

By default the strategy reads a table named agent_connections:

| column | holds | |---|---| | user_id | matches the nominee user | | provider | matches the nominee connection (e.g. github) | | refresh_token | the provider refresh token you stored at sign-in | | access_token | cached provider access token (written back on refresh) | | expires_at | access token expiry (ISO string or epoch) |

create table agent_connections (
  user_id text not null,
  provider text not null,
  refresh_token text,
  access_token text,
  expires_at timestamptz,
  primary key (user_id, provider)
);

Override any name via columns, the table via table, and the schema via schema. Set persist: false to never write refreshed tokens back.

How it resolves a token

  1. Read the (user, provider) row.
  2. If a cached access_token is still fresh, return it — no provider call.
  3. Otherwise refresh the refresh_token at the provider, return the new token, and (by default) persist it back to the row.

If a connection has no refresh config, the stored access_token is returned as-is and nominee re-reads it next time.