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

vibe-button

v0.0.8

Published

A single button that connects your user to Azure OpenAI.*

Readme

Vibe Button

A single button that connects your user to Azure OpenAI.*

Live documentation + demo

One Button to rule them all
One Button to find them
One Button to bring them all
and in Café 16
Vibe them
—Gandalf the Vibe

*This is NOT a Microsoft official library.

Install

Include a script tag in of html

<head>
  <script type="module" src="https://esm.sh/vibe-button"></script>
</head>

Put the settings button somewhere in the <body> of your HTML

<body>
  <vibe-button></vibe-button>
</body>

To display it at a specific corner of the screen, set position. Default is "bottom-right".

<vibe-button position="top-right"></vibe-button>
<vibe-button position="top-left"></vibe-button>
<vibe-button position="bottom-right"></vibe-button>
<vibe-button position="bottom-left"></vibe-button>

Usage

The user can click the <vibe-button> to open the settings dialog where they can provide Azure OpenAI endpoint, deployment name, and API key

As a developer, you can only query the settings object after the SDK script tag is loaded. You can instantiate an AzureOpenAI client instance using the settings from the button element:

const settings = document.querySelector("vibe-button").settings;

The settings object contains all the necessary properties to construct the new AzureOpenAI({...}) instance as documented in https://github.com/openai/openai-node. Note that the AzureOpenAI constructor only requires endpoint, apiKey, deployment, and apiVersion properties. The model property is only used for creating the response.

import { AzureOpenAI } from 'https://esm.sh/openai';

function submitChat() {
  const settings = document.querySelector('vibe-button').settings;
  const client = new AzureOpenAI({
    endpoint: settings.endpoint,
    apiKey: settings.apiKey,
    deployment: settings.deployment,
    apiVersion: settings.apiVersion,
    dangerouslyAllowBrowser: true
  });
  const response = await client.responses.create({
    model: settings.model,
    instructions: 'You are a coding assistant that talks like a pirate',
    input: 'Are semicolons optional in JavaScript?',
  });

  console.log(response.output_text);
}

Programmatically update settings

You can programmatically update the settings stored in the <vibe-button> using the updateSettings method. This is useful for pre-filling or changing the endpoint, API key, or deployment from your own code:

const vibeButton = document.querySelector('vibe-button');
vibeButton.updateSettings({
  aoaiEndpoint: 'https://your-endpoint.openai.azure.com/',
  aoaiApiKey: 'your-api-key',
  aoaiDeployment: 'your-deployment-name',
});
  • aoaiEndpoint: Azure OpenAI endpoint URL
  • aoaiApiKey: Azure OpenAI API key
  • aoaiDeployment: Azure OpenAI deployment name

The settings dialog and the .settings property will reflect these changes.

To stream the response, you can set stream: true

import { AzureOpenAI } from 'https://esm.sh/openai';

function streamChat() {
  const settings = document.querySelector('vibe-button').settings;
  const client = new AzureOpenAI({
    endpoint: settings.endpoint,
    apiKey: settings.apiKey,
    deployment: settings.deployment,
    apiVersion: settings.apiVersion,
    dangerouslyAllowBrowser: true
  });

  const stream = await client.responses.create({
    model: settings.model,
    input: 'Say "Sheep sleep deep" ten times fast!',
    stream: true,
  });

  for await (const event of stream) {
    console.log(event);
    /** Example delta event:
      {
        "type": "response.output_text.delta",
        "item_id": "msg_68438d02463081908f4fdce178bc5c74007cd4a1adc270d4",
        "output_index": 0,
        "content_index": 0,
        "delta": "Sheep, "
      }
    */
  }
}

The AzureOpenAI constructor is not provided by the SDK. If in the browser environment, we recommend using https://esm.sh/openai. Otherwise, you can use openai package from npm.