Skip to content

xaronnn/js-lanyard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JS-Lanyard

Use Lanyard in your Web App. Phineas - Creator of Lanyard API

CDN

  • Call to your page (https://cdn.jsdelivr.net/gh/0x5841524f4e/js-lanyard/lanyard.js)

Usage

Using without websocket:

 // rest with single user example
lanyard({
    userId: "213325478096797697",
}).then(console.log) // presenceData

// rest with multiple  users example
lanyard({
    userId: ["213325478096797697", "331846231514939392"],
}).then(console.log) // presenceData[]

Using with websocket:

// websocket with single user example
lanyard({
    userId: "213325478096797697",
    socket: true,
    onPresenceUpdate: console.log // presenceData
}) // returns a websocket

// websocket with multiple users example
lanyard({
    userId: ["213325478096797697", "331846231514939392"],
    socket: true,
    onPresenceUpdate: console.log // presenceData[]
}) // returns a websocket

License

Distributed under the GPL-3.0 License. See LICENSE for more information.