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

@vuemodel/supabase

v0.0.5

Published

Marrying the composition API with VuexOrm and Supabase

Readme

What's

A Quick Note...

Currently, this package is a bit of an experiment! If you'd like to use these concepts in production that's okay, yet I'd recommend forking this repo and making it your own. At least until these concepts standardize.

Enough preamble. Let's dive in! 🤿

Installation

import { SupabasePlugin } from '@vuemodel/supabase'

Vue.install(SupabasePlugin, {
  credentials: {
    supabaseUrl: 'your-supabase-url',
    supabaseKey: 'your-supabase-key'
  }
})

Usage

useModel

import { useModel } from '@vuemodel/supabase'

export default class Todo extends Model {
  static entity = 'todos'

  static fields () {
    return {
      id: this.uid(),
      title: this.string(''),
      done: this.boolean(false),
    }
  }
}

const todoService = useModel(Todo)

/**
 * 🤿 When finding, upating, or deleting a model
 * You first need to set the id
 */
todoService.id.value = 7
todoService.find()
todoService.remove()

/**
 * 🤿 When creating/updating a new model, the form is
 * already generated for you!
 */

// Creating
todoService.form.value {
  title: 'buy shoes',
  done: false
}
todoService.create()

// Updating
todoService.form.value {
  done: true
}
todoService.update()

/**
 * Of course, we have access to the model
 */
todoService.id.value = 7
console.log(todoService.model.value)

/**
 * Need to reset the form? Gotcha covered!
 */
todoService.resetForm()

/**
 * You don't even have to deal with errors!
 */
todoService.form.value {
  done: 'this should be a boolean 😱'
}
await todoService.update()
console.log(todoService.error.value)

/**
 * We have access to all of the models
 * possible loading states...
 */
todoService.creating.value
todoService.finding.value
todoService.updating.value
todoService.removing.value
todoService.loading.value

useModelCollection

useModelCollection hasn't been fleshed out yet! More to come :)

import { useModelCollection } from '@vuemodel/supabase'

export default class Todo extends Model {
  static entity = 'todos'

  static fields () {
    return {
      id: this.uid(),
      title: this.string(''),
      done: this.boolean(false),
    }
  }
}

const todoCollectionService = useModel(Todo)

/**
 * 🤿 Let's go get some models from the backend!
 */
todoCollectionService.index()

/**
 * 🤿 Filter models by ids
 */
todoCollectionService.ids.value = [1,3,5]

/**
 * 🤿 Of course, you'll want access to the collection...
 */
todoCollectionService.collection.value

/**
 * 🤿 Want to add in a loading spinner?
 */
todoCollectionService.indexing.value

/**
 * 🤿 And finally, let's take a look at error handling
 */
await todoCollectionService.index()
console.log(todoCollectionService.error.value)

Destructuring

Note that in the real world, you'll probably want to use destructuring. For example:

<script setup>
const { form, create, creating, error } = useModel(Todo)
</script>

<template>
<input v-model="form.title">

<button :disabled="creating" @click="create">create</button>

<span v-if="creating">creating...</span>
<span v-if="error">{{ error.message }}</span>
</template>

Coming Soon!

I'll likely add:

  • Scoping
  • Filtering
  • Batch operations As the Supabase API makes this possible! So stay tuned for that 😄