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

@rich-apis/poly-widgets

v1.0.0

Published

Embeddable Polymarket odds widgets for blogs and news sites

Downloads

96

Readme

Poly Widgets

Embeddable Polymarket odds widgets for blogs and news sites. One script tag gives you live probability bars that auto-refresh every 60 seconds. Under 10KB, no dependencies.

Quick Start

Add this to any HTML page:

<script src="https://your-domain.vercel.app/embed.js"
  data-market-slug="will-donald-trump-win-the-2024-us-presidential-election"
  data-theme="light">
</script>

The widget renders itself right after the script tag. No extra divs, no CSS imports, no build step.

Configuration

All config goes through data- attributes on the script tag:

| Attribute | Default | Description | |---|---|---| | data-market-slug | required | Polymarket market slug | | data-market-id | - | Alternative: use market ID instead of slug | | data-theme | light | light or dark | | data-width | 480px | Max width of the widget | | data-key | - | API key (white-label/premium tiers) |

JavaScript API

For programmatic use:

// Include embed.js on the page first

var widget = PolyWidget.create('#my-container', {
  slug: 'market-slug-here',
  theme: 'dark',
  apiBase: 'https://your-domain.vercel.app'
});

// Refresh manually
widget.refresh();

// Remove the widget
widget.destroy();

npm Install

npm install @rich-apis/poly-widgets
require('@rich-apis/poly-widgets');
// PolyWidget is now available globally

Self-Hosting

Prerequisites

  • Node.js 18+
  • Vercel CLI (npm i -g vercel)

Setup

  1. Clone the repo
  2. Copy .env.example to .env
  3. Run vercel dev for local development
  4. Deploy with vercel --prod

API Endpoints

  • GET /api/v1/market?slug=xxx - Fetch a single market by slug
  • GET /api/v1/market?id=xxx - Fetch a single market by ID
  • GET /api/v1/markets?q=xxx&limit=10 - Search/list markets

API Key Tiers

Set these in your .env to enable paid tiers:

  • WHITELABEL_KEYS - Comma-separated keys for the $9/mo tier (removes branding)
  • PREMIUM_KEYS - Comma-separated keys for the $29/mo tier (extra data fields)

Pricing

| Tier | Price | What you get | |---|---|---| | Free | $0 | All features, "Powered by PolySignals" branding | | White Label | $9/mo | No branding | | Premium | $29/mo | No branding, extended market data, volume/liquidity details |

Project Structure

poly-widgets/
  api/v1/
    market.js      # Single market endpoint
    markets.js     # List/search endpoint
  public/
    embed.js       # The widget (include this on your site)
    index.html     # Landing page
    demo.html      # Live demo page
  .env.example
  vercel.json
  package.json

Disclaimer

This is an analytical tool. Not financial advice. Past data does not predict future results. Market data sourced from public Polymarket APIs.