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

community-widget-test

v1.0.86

Published

description

Readme

About

This package was created to implement a chat between mentors and explorers on the prodigyfinance.com.

Before installation

  • ensure that you have get-stream API key which can be found on get-stream's dashboard
  • you have access to the current user's userAccessToken needed for logging in.

Steps to install the package

  1. add .npmrc file to the root of your project with following contents:
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
@prodigyfinance:registry=https://npm.pkg.github.com
  1. run
npm i @prodigyfinance/community-widget
  1. create .env variable containing get-stream API key (e.g. GATSBY_GETSTREAM_API_KEY)
  2. create a component containing community-widget and pass needed props:
  • streamApiKey - get-stream API key (e.g. process.env.GATSBY_GETSTREAM_API_KEY)
  • navigationState - an object { isChannelsListScreen: boolean, selectedMentorId: string } that contains info needed for redirecting the user inside of the widget after the user is redirected back to the website after successfull logging in. For example, if navigationState.isChannelsListScreen === true, user gets instantly redirected to the screen with a list of their active channels. Or if navigationState.selectedMentorId contains an id of the mentor, the user gets redirected to chat-screen with that particulat mentor. These values can be obtained through params and passed to the widget when the user gets back to the web-site after successfull loging in
  • onLoginButtonClick and onSignUpButtonClick - callbacks that get invoked when the user presses 'Log in' or 'Sign Up' buttons on widget. Their only argument is an object which contains { isChannelsListScreen: boolean } or { selectedMentorId: string }. The argument is suposed to be passed to login-api/signup-api through params and the user is supposed to be redirected to login/sign-up page. The query may look like https://www.loginapi.com/login?isChannelsListScreen=true or https://www.loginapi.com/login?selectedMentorId=someCrazyHashedMentorId. E.g. possible scenarios:
    • unauthenticated user presses a button that leads to the screen with active channels → user sees a screen with 'Log In' button → user presses 'Log In' button (that's the point where { isChannelsListScreen: true } is passed to login site through params) → user gets redirected to login-site, fills the creadentials and is successfully logged in → user gets redirected back to the website ({ isChannelsListScreen: true } is passed through the params to website) → user sees the widget with channels-list screen
    • unauthenticated user presses a button to chat with some mentor → user sees a screen with 'Log In' button → user presses 'Log In' button (that's the point where { selectedMentorId: 'someCrazyHashedMentorId } is passed to login site through params) → user gets redirected to login-site, fills the creadentials and is successfully logged in → user gets redirected back to the website ({ selectedMentorId: 'someCrazyHashedMentorId } is passed through the params to website) → user sees the widget with chat screen with mentor who's id is someCrazyHashedMentorId.
  • isAuthStateLoading - to prevent the widget from displaying while authentication process is in progress
  • userAccessToken - access token needed for authenticating the user on community-backend
  • launchDarklyApiKey - api key for launch-darkly
  • baseUrl - url to the backend
import { CommunityWidget } from '@prodigyfinance/community-widget'

const CommunityWidgetContainer = () => {
  const { userAccessToken, isAuthStateLoading } = useAuthContext();
  const { widgetNavigationState } = useAppContext()

  const onLoginCallback = (navigationValue) => {
    dispatch({
      type: 'UPDATE_WIDGET_NAVIGATION_STATE',
      payload: navigationState,
    })
  }

  return (
    <CommunityWidget
      isAuthStateLoading={isAuthStateLoading}
      streamApiKey={process.env.GATSBY_GETSTREAM_API_KEY}
      onLoginButtonClick={onLoginCallback}
      onSignUpButtonClick={onSignUpButtonClick}
      navigationState={widgetNavigationState}
      userAccessToken={user?.access_token}
      launchDarklyApiKey={process.env.GATSBY_PRODIGY_LAUNCH_DARKLY_CLIENT_ID}
      baseUrl={process.env.REACT_APP_BACKEND_URL}
    />
  );
};
  1. put it into your website, e.g. into gatsby-browser.js:
export const wrapRootElement = ({ element }) => {
  return (
    <ErrorBoundary>
      <GlobalContextProvider>
        <CommunityWidgetContainer />
        {element}
      </GlobalContextProvider>
    </ErrorBoundary>
  );
};

Happy hacking!