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

@vitibase/server

v0.1.1

Published

Server-side utilities for Vitibase — auth, client creation and context injection for your API routes.

Downloads

34

Readme

@vitibase/server

Server-side utilities for Vitibase — authentication, client creation and context injection for the API routes your application serves.

npm install @vitibase/server
import { withVitibase } from '@vitibase/server'

export default {
  fetch: withVitibase({ auth: 'user' }, async (req, ctx) => {
    const { data } = await ctx.supabase.from('orders').select('id, total')
    return Response.json({ user: ctx.userClaims?.sub, orders: data })
  }),
}
# .env — a project ref and two keys is a complete configuration
VITIBASE_PROJECT_REF=abcdefghijklmnopqrst
VITIBASE_ANON_KEY=eyJ...
VITIBASE_SERVICE_ROLE_KEY=eyJ...

What it reads

| Variable | Meaning | | ---------------------------------------------------- | ------------------------------------------------------ | | VITIBASE_PROJECT_REF | Your project ref. The URL and key set URL come from it | | VITIBASE_URL | A full project URL, if it is not on vitibase.in | | VITIBASE_ANON_KEY / VITIBASE_PUBLISHABLE_KEY | The key browsers use | | VITIBASE_SERVICE_ROLE_KEY / VITIBASE_SECRET_KEY | The key your server uses | | VITIBASE_PUBLISHABLE_KEYS / VITIBASE_SECRET_KEYS | A JSON object of named keys, for more than one | | VITIBASE_JWKS_URL / VITIBASE_JWKS | Only if you are not using the project's published set |

The key set URL is derived from the project, so you rarely set it: every Vitibase project publishes its public signing key at /auth/v1/.well-known/jwks.json, and that endpoint is reachable without an API key because the libraries that fetch it cannot send one.

Anything you pass in config.env wins over the environment, field by field.

Verifying a user, which needs asymmetric keys

auth: 'user' verifies an end user's access token against your project's published key set — no shared secret on your server. That works because Vitibase projects sign user tokens with an ES256 key and publish the public half; a project created before that needs migrating once (POST /platform/projects/{ref}/jwt-keys from the dashboard's API, Administrator only).

auth: 'publishable' and auth: 'secret' check API keys and work on any project.

The context keys keep their upstream names

ctx.supabase, ctx.supabaseAdmin, ctx.userClaims and ctx.jwtClaims are what the library sets, and this package does not rename them. A wrapper that renamed the keys in its documentation but not in the object would hand you undefined at runtime, which is a worse trade than a familiar name in your handler.

Everything else

Every entry point of the library underneath is re-exported at the matching path:

import { withVitibase } from '@vitibase/server/adapters/hono'
import { withPostgresClient } from '@vitibase/server/middleware/postgres'
import { resolveEnv } from '@vitibase/server/core'

The adapters (Hono, H3, Elysia, NestJS) and the Postgres middleware need their own framework installed — they are optional peers, so you only get what you use.

What this package is

A thin layer over @supabase/server, which it re-exports in full. What it adds is the part a rename could not: this platform's variable names, and a project ref that becomes both a URL and a key set URL. withSupabase and every other upstream export are still exported under their original names, so an existing codebase changes one import line.

Licence and attribution

Apache-2.0. Depends on @supabase/server, copyright Supabase, Inc. Supabase is a trademark of Supabase, Inc., which does not endorse Vitibase.