Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.08 KB

README.md

File metadata and controls

45 lines (33 loc) · 1.08 KB

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.