Skip to content

Commit f21ab39

Browse files
committed
chore: update ReadMe and examples folder
1 parent 1965914 commit f21ab39

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,24 @@ const np = new NowPlaying(Providers.SPOTIFY, {
1818
storageKind: StorageKinds.INMEMORY,
1919
});
2020
```
21+
22+
23+
### With Spotify
24+
```ts
25+
import {
26+
NowPlaying,
27+
Providers,
28+
StorageKinds,
29+
} from "@BolajiOlajide/now-playing";
30+
31+
const np = new NowPlaying(Providers.SPOTIFY, {
32+
storageKind: StorageKinds.INMEMORY,
33+
useCache: false, // default is true
34+
cacheDuration: 30000, // in milliseconds
35+
streamerArgs: {
36+
clientId: "foo",
37+
clientSecret: "bar",
38+
refreshToken: "baz",
39+
}
40+
});
41+
```

examples/spotify.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { NowPlaying, Providers, StorageKinds } from "../src";
2+
3+
const np = new NowPlaying(Providers.SPOTIFY, {
4+
storageKind: StorageKinds.INMEMORY,
5+
useCache: false,
6+
cacheDuration: 30000, // in milliseconds
7+
streamerArgs: {
8+
clientId: "foo",
9+
clientSecret: "bar",
10+
refreshToken: "baz",
11+
}
12+
});
13+
14+
console.log("Hello World", np);

0 commit comments

Comments
 (0)