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

firebase-supabase-function-bridge

v2.3.0

Published

Bridge between Firebase Functions and Supabase HTTP triggers.

Readme

Firebase Supabase Function Bridge

Do you use Firebase and Supabase together? This package aims to bridge them using Supabase's webhooks (similar to triggering a function from a Firestore change).

Instead of calling Firebase to create your functions, create this package's wrapper instead. It will ensure the payload is correct (including a custom API token to ensure it's really you):

import {
  createSupabaseFunction,
  Operation,
} from 'firebase-supabase-function-bridge'

interface PhotoRecord {
  id: string
}

export const myFunctionName = createSupabaseFunction<PhotoRecord>(
  'photos',
  Operation.Create,
  (req, res) => {
    const myPhoto = req.body.record

    // do stuff...
  }
)

Testing

Tested in my local Docker environment and deployed to prod (May 2026) with separate .env files:

  • Firebase functions [Node.js 20]
  • Supabase local with Docker [Postgres 17.1]
  • Supabase deployed [Postgres 15.1]

Unit tests have been written too :)

Usage

  1. Install the package:

    npm i firebase-supabase-function-bridge
  2. Add these required env vars to your Firebase .env file (eg. .env.dev or .env.prod):

| Env var | Desc | Example | | --------------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | BRIDGE_FUNCTIONS_BASE_URL | The base URL of your Firebase functions. | Prod: https://us-central1-$projectId.cloudfunctions.netDev: http://host.docker.internal:5000/$projectId/us-central1 | | SUPABASE_CUSTOM_API_KEY | An API key to prove the HTTP request is coming from your Supabase SQL trigger. | my-custom-secret-key | | POSTGRESQL_CONNECTION_URL | The connection URL to your Supabase Postgres database. | Prod: postgresql://postgres.$projectid:[email protected]:5432/postgresDev: postgresql://postgres:[email protected]:54322/postgres |

Then create your function using createSupabaseFunction:

import {
  createSupabaseFunction,
  Operation,
} from 'firebase-supabase-function-bridge'

interface PhotoRecord {
  id: string
}

export const myFunctionName = createSupabaseFunction<PhotoRecord>(
  'photos',
  Operation.Create,
  (req, res) => {
    const myPhoto = req.body.record

    // do something with your photo

    res.status(200).send({ message: 'Success!' })
  }
)

You can also specify a basic WHERE condition to avoid unnecessary HTTP requests:

export default createSupabaseFunction<PhotoRecord>(
  'users',
  Operation.Update,
  (req, res) => {
    const oldProfile = req.body.old_record
    const newProfile = req.body.record

    console.log(
      `You changed your username from "${oldProfile.username}" to "${newProfile.username}"`
    )

    res.status(200).send({ message: 'Success!' })
  },
  undefined,
  `NEW.username <> OLD.username`
)

Note: Firebase automatically sends status 200 if you do not specify a status.

Options

--project=your_project_id_or_alias

The Firebase project ID or alias, used to determine the .env file location. eg. --project=dev will look for .env.dev.

--env=path/to/.env

Override the path to the .env file instead of determining it from --project.

--functions=myFuncName,anotherFuncName

A comma delimited list of Firebase function names to deploy.

--debug

Show extra output such as SQL statements.

--initApp

Initialise Firebase Admin for you. This usually conflicts with your Firebase Functions code so not recommended.

--timeoutMs

Override the HTTP request timeout (default 2000).

Development

npm i

Publishing

npm run build
cd dist
npm publish