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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-discord-presence

v16.0.0

Published

Display your Discord presence in react.

Downloads

143

Readme

react-discord-presence

Version Open Issues License

> (unofficial) <

Display your Discord presence.

yarn add react-discord-presence

Example

Check it out on StackBlitz.

Screenshot React Discord Presence

Loading State

Screenshot Loading React Discord Presence

Error State

Screenshot Loading React Discord Presence

You can find more examples in docs/Examples.md.

Features

  • Self Contained
  • Banner
  • Avatar
  • User Online Status
  • User Status
  • Emojis
  • Badges (Boost badge will match premium_since)
  • About Me
  • Member Since (Mostly, icons are on the Roadmap)
  • Spotify
  • Activity
  • Customization

Please note that this component is only possible by the Lanyard API and the work done to get the correct data pulled into the display components.

Requirements

This solution uses the Lanyard API which will require the Discord user your displaying presence for to be in the Lanyard API Discord. You will also have to have "Developer Mode" on for the user.

If they're not in the Discord server, you'll get a response error from their API.

Usage

You can use the self contained DiscordPresence component which will handle data retrieval, loading, error, and display states automatically for you.

You can also use the discord-presence network widget/svg component instead.

React

import { DiscordPresence } from 'react-discord-presence';

// ...
<DiscordPresence args={{ developerId: "<your-developer-id>" }} />

Widget

<object data="https://discord-presence.netlify.app/render/<your-developer-id>">
  <embed src="https://discord-presence.netlify.app/render/<your-developer-id>"></embed>
</object>

SVG

<img src="https://discord-presence.netlify.app/render/svg/<your-developer-id>" />

Custom

For fine grained control see docs/Customization.md.

Development

Written in Typescript. Workflows are defined in .envrc.sh.

External Resources

Roadmap

  • "iframe" embed
    • https://github.com/nwtgck/gh-card
    • https://legacy.reactjs.org/docs/react-dom-server.html
    • https://razzlejs.org/getting-started

Display

  • Update memberSince to use (developerId / 4194304 + 1420070400000) / 1000.
  • Modify Twemoji to use ErrorImage when the emoji image errors.
  • Support for overflow in activities & activity details? Should this be a custom scrollbar?
  • Find SVG badges for 'TeamPseudoUser', 'VerifiedBot', 'CertifiedModerator', 'BotHTTPInteractions', 'Spammer', and 'Quarantined'

Data

  • Support for realtime presence data with the web socket API.
  • Support for automated queries on an interval.
  • Support for custom maxDelay on call site.

Build

  • Flatten asset distributable output (CSS/Images/etc)

Contributions

| Author | Estimated Hours | | ------------- | ------------- | | nate-wilkins | 34.3 Hours | | dependabot[bot] | 0.52 Hours |