Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-listen-along

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-listen-along - npm Package Compare versions

Comparing version 1.0.0 to 1.1.1

2

package.json
{
"name": "use-listen-along",
"description": "A react hook to listen alongside others on spotify.",
"version": "1.0.0",
"version": "1.1.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -1,3 +0,3 @@

# 🌙 wrap-presence
#### An official wrapper for [presence](https://presence.im).
# 👥🎵 use-listen along
#### Typescript React Hook for listening along on spotify.

@@ -9,6 +9,6 @@ ### 📦 Installation

via NPM
> npm i --save wrap-presence
> npm i --save use-listen-along
via yarn
> yarn add wrap-presence
> yarn add use-listen-along

@@ -20,22 +20,24 @@ ### ⌨️ Usage

```tsx
import { wrapPresence } from 'wrap-presence';
import { useListenAlong } from 'use-listen-along';
const Presence = async () => {
const req = {
platform: 'twitter',
type: 'user',
params: 'atmattt',
};
const {data, error, isLoading} = await wrapPresence(req);
const Spotify = () => {
const [connection, setConnection] = React.useState<boolean>(false);
// The discord ID of the user you wish to listen-along to.
const snowflake = 291050399509774340;
// The spotify authorization code.
let auth_code: string;
function listen(disconnect) {
// Get auth from spotify with scope 'user-modify-playback-state'.
const {connected, error} = useListenAlong(snowflake, auth_code, disconnect);
setConnection(connected);
}
if (isLoading) {
return <p>Loading...</p>
} else if (error) {
return <p>An error has occured!</p>
}
return data;
return (
<button onClick={() => listen(connection ? true : false)}> {connection ? 'Disconnect' : "Listen Along"} </button>
)
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc