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

swap-chat-js

v1.0.32

Published

Downloads

24

Readme

Intro

SwapChat-js is a small sdk that allows you to use swapchat more quickly see SwapChat-js docs

You can install and experience swapchat in chrome first

Downloads SwaChat Extension

Installation

npm i swap-chat-js

or

yarn add swap-chat-js

Usage

import SwapChatSdk from 'swap-chat-js';

// You need to create an instance of SwapChatSdk Pass in two dom elements as parameters.
// The first element is the trigger that brings up the element and the second element is the slot container for the chat tool
const SwapChatSdkStance = new SwapChatSdk({
    dom1,
    dom2
    {width:400,height:600},{
      platform:'twitter',
      type:'single',
      room_payload:{
        user_name:'yihang1314'
      }
    }
  }
    );
//  Methods requiring calls to instances instance.exect()
SwapChatSdkStance.exect()

Using swapchat-js in react

Twitter 1v1 chat

const params = {
  platform: "twitter",
  type: "single",
  room_payload: {
    user_name: "SwapChatNFT",
    user_avatar:
      "https://pbs.twimg.com/profile_images/1506560330876731393/tLk4jXKq_400x400.jpg",
  },
};

Group chat with Twitter space

const params = {
      platform: 'twitter',
      type: 'group',
      room_payload: {
        space_id: '1BdxYwElXVoGX',
        space_title: '测试3',
      },
    };

Opensea 1v1 chat

const params = {
      platform: 'opensea',
      type: 'single',
      room_payload: {
        user_name: 'king250',
      },
    };

Group chat with opensea collection

const params = {
      platform: 'opensea',
      type: 'group',
      room_payload: {
        collection_name: 'founders-coins',
      },
    };

Opensea nft item create thread chat

const params = {
      platform: 'opensea',
      type: 'thread',
      room_payload: {
        opensea_coll_slug: 'yoloholiday',
        opensea_item_token_id: '4096',
        opensea_item_contract_address:
          '0xb5643598496b159263c67bd0d25728713f5aad04',
        chain_name: 'ethereum',
      },
    };

Discord 1v1 chat

const params = {
      platform: 'discord',
      type: 'single',
      room_payload: {
        user_name: '方庭',
        user_id: '3162',
      },
    };
import SwapChatSdk from 'swap-chat-js';
import react, { useEffect, useRef } from "react";
function App() {
  const buttonRef = useRef();
  const containRef = useRef();
  useEffect(() => {
    const params = {
      platform:'twitter',
      type:'group',
      room_payload:{
          // user_name:'yihang1314'
         space_id: '1MYxNnoyanwxw',
      }
    };
    const SwapChatSdkStance = new SwapChatSdk(
      buttonRef.current,
      containRef.current,
      {
        width:400,
        height:600,
      },
       { ...params }
    );
    SwapChatSdkStance.exect();
  }, []);
  return (
    <div className="App">
      <button ref={buttonRef}>swapChat</button>
      <div ref={containRef}></div>
    </div>
  );
}

export default App;

Using swapchat-js in vue

<template>
  <div class="hello">
    <button ref="button"></button>
    <div ref="container">
    </div>
  </div>
</template>
<script>
import { getCurrentInstance} from 'vue';
import SwapChatSdk from 'swap-chat-js'
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  mounted() {
    const instance = getCurrentInstance()
     const SwapChatSdkStance = new SwapChatSdk(
      instance.refs.button,
      instance.refs.container,
      {
        width: 400,
        height: 600
        },
      {
      platform:'discord',
      type:'single',
      room_payload:{
          user_name:'方庭#3162'
        //  space_id: '1MYxNnoyanwxw',
      }
    }
    );
    SwapChatSdkStance.exect();
  }
}
</script>