Skip to content

Commit 0c7c450

Browse files
authored
Update README.md
1 parent f82f086 commit 0c7c450

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,18 @@ value:
7373
```js
7474
// If you use our Podcast API with Node.js or browser javascript, then use the Client class.
7575
const { Client } = require('podcast-api');
76+
const client = Client({
77+
apiKey: process.env.LISTEN_API_KEY || null,
78+
});
7679

7780
// If you use our Podcast API with Cloudflare Workers / Pages, then use the ClientForWorkers class.
81+
// Please make sure you store LISTEN_API_KEY as a secret. See example code:
82+
// - https://github.com/ListenNotes/podcast-api-js/blob/cloudflare-workers/examples/PodcastAppForWorkers/src/index.js
7883
// const { ClientForWorkers } = require('podcast-api');
79-
// const Client = ClientForWorkers
84+
// const client = ClientForWorkers({
85+
// apiKey: env.LISTEN_API_KEY || null,
86+
// });
8087

81-
const client = Client({
82-
apiKey: process.env.LISTEN_API_KEY || null,
83-
});
8488

8589
client.search({
8690
q: 'elon musk',

0 commit comments

Comments
 (0)