diff --git a/README.md b/README.md index 2893bdf..241b53b 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,24 @@ const np = new NowPlaying(Providers.SPOTIFY, { storageKind: StorageKinds.INMEMORY, }); ``` + + +### With Spotify +```ts +import { + NowPlaying, + Providers, + StorageKinds, +} from "@BolajiOlajide/now-playing"; + +const np = new NowPlaying(Providers.SPOTIFY, { + storageKind: StorageKinds.INMEMORY, + useCache: false, // default is true + cacheDuration: 30000, // in milliseconds + streamerArgs: { + clientId: "foo", + clientSecret: "bar", + refreshToken: "baz", + } +}); +``` diff --git a/examples/spotify.ts b/examples/spotify.ts new file mode 100644 index 0000000..6d54fe4 --- /dev/null +++ b/examples/spotify.ts @@ -0,0 +1,14 @@ +import { NowPlaying, Providers, StorageKinds } from "../src"; + +const np = new NowPlaying(Providers.SPOTIFY, { + storageKind: StorageKinds.INMEMORY, + useCache: false, + cacheDuration: 30000, // in milliseconds + streamerArgs: { + clientId: "foo", + clientSecret: "bar", + refreshToken: "baz", + } +}); + +console.log("Hello World", np);