1.0.0 • Published 2 years ago

use-lanyard-react v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

use-lanyard

A React Hook for Lanyard. An API that exposes your Discord & Spotify presence to the web!

NPM JavaScript Style Guide

Install

npm install --save use-lanyard

Usage

import * as React from 'react'

import { useLanyard } from 'use-lanyard'

const Example = () => {
  const state = useLanyard('DISCORD_ID')
  return (
    <div>
      {state.listening_to_spotify ? `Wohoo! I'm listening to Spotify right now.` : `I'm not listening to anything right now :(`}
    </div>
  )
}

License

MIT © 220ish