Skip to content

itemsCenter/use-lanyard

Repository files navigation

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-react
or
yarn add use-lanyard-react

Usage

import * as React from 'react'

import { useLanyard } from 'use-lanyard-react'

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

About

🏷️ A React Hook for Lanyard with @types support

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published