Skip to content

Commit

Permalink
chore: update ReadMe and examples folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lilpolymath committed Jun 14, 2024
1 parent 1965914 commit f21ab39
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
});
```
14 changes: 14 additions & 0 deletions examples/spotify.ts
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit f21ab39

Please sign in to comment.