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

@rayvin-connect/rayvin-connect

v1.0.1

Published

Connect to the Rayvin data feed and API

Readme

Rayvin Connect

Rayvin Connect allows you to tap into the data feed from Rayvin so that you can extend and customize the functionality to work in ways that we haven't thought of yet. You can create complex filters, build your own UI to display information in a custom way, or even implement your own pricing models.

Once your custom logic determines that you are interested in a moment, you can leverage Rayvin's notification system to send yourself a notification over email or Telegram (just like we do for Price Watch alerts).

This repository contains a JavaScript library that implements the interface of Rayvin Connect, but you can consume the API in whatever language/environment that you'd like. Check out the API Reference for details about the available endpoints.

Take a look at ravyin-connect-dashboard to see a basic implementation of a custom React web application built using Rayvin Connect.

NOTE: In order to generate an API key for Rayvin Connect, you need an active subscription to Rayvin that includes the Market Assist feature


Beta

Rayvin Connect is still very much in beta. We don't plan on making any breaking changes, but please always check this repository for the latest information about the status of the API and library. If you run into any issues, please report them on this repository.

We are planning on expanding the functionality available through the API, and are very receptive to any feature requests. Create an issue on this repository if there is something that you'd like to see!


Quickstart

If you want to dive right in, just install the package from NPM into a JavaScript project and paste the example code below. If you want to dig deeper, check out the full documentation.

npm install @rayvin-connect/rayvin-connect

You can find the following code in the basic-feed example:

import { momentUrl, niceVisualName } from '@rayvin-connect/rayvin-connect/lib/lib/helpers/top-shot-helpers'
import { RayvinClient, RayvinFeed } from '@rayvin-connect/rayvin-connect'

// this example connects to Rayvin's real-time marketplace feed and outputs all new listings to the console

(async () => {
  // you will need to generate an API key on https://rayvin.io/ to access the API
  // log in and navigate to the "Rayvin Connect" page from the header navigation menu
  const API_KEY = 'YOUR_API_KEY_GOES_HERE'

  // create the HTTP API client
  const client = new RayvinClient(API_KEY)

  // create the real-time feed client
  const feed = new RayvinFeed(client)

  // the "pong" event will be emitted every time the server responds to the automatic ping requests
  feed.on('pong', ev => console.log(`Pong: ${ev.pingTime}ms`))

  // the "error" event will be emitted when an error occurs
  feed.on('error', ev => console.error(`Error: ${ev.error}`))

  // the "connected" event will be emitted when the real-time feed connects to the server
  feed.on('connected', () => console.log('Connected'))

  // the "disconnected" event will be emitted if the real-time feed disconnects from the server
  feed.on('disconnected', () => console.log('Disconnected'))

  // the "moment-listed" event will be emitted every time a new listing is posted to the marketplace
  feed.on('moment-listed', ev => {
    const isNewLowestAsk = Boolean(ev.previousLowestAsk && ev.previousLowestAsk > ev.listing.price)

    const momentInfo: string[] = [
      `${ev.play.playerName} ${ev.play.playCategory} #${ev.moment.serialNumber}/${ev.setPlay.circulationCount}`,
      `${ev.set.name} (${ev.set.seriesName}) ${niceVisualName(ev.set.visualId)}`,
      `$${ev.listing.price}${isNewLowestAsk ? ` NEW LOWEST` : ''}`,
      momentUrl(ev.moment.externalId),
    ]

    console.log(`${momentInfo.join('\n')}\n---`)

    if (isNewLowestAsk) {
      // uncomment this to receive a notification (through the Rayvin alert system) every time there is a new lowest ask posted to the marketplace
      // client.sendNotification({
      //   message: `New lowest ask:\n${momentInfo.join('\n')}`,
      // })
    }
  })

  // the "moment-purchased" event will be emitted every time a listing is purchased from the marketplace
  feed.on('moment-purchased', ev => {
  })

  // the "moment-withdrawn" event will be emitted every time a listing is withdrawn from the marketplace
  feed.on('moment-withdrawn', ev => {
  })

  // connect to the real-time marketplace listing feed
  console.log('Connecting...')
  await feed.connect()

  await new Promise(resolve => {
    // just wait until the application is terminated
  })
})()