Skip to content

Commit

Permalink
fix(chapters): 🥅 throw error if no env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Sep 21, 2021
1 parent 93a4209 commit f4f8085
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/helpers/audibleChapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class ChapterHelper {
const baseUrl: string = '1.0/content'
const params = 'metadata?response_groups=chapter_info'
this.reqUrl = helper.buildUrl(asin, baseDomain, baseUrl, params)
if (!process.env.ADP_TOKEN && !process.env.PRIVATE_KEY) {
throw new Error('Missing environment vars for chapters')
}
this.adpToken = process.env.ADP_TOKEN as string
this.privateKey = process.env.PRIVATE_KEY as string
this.privateKey = this.privateKey.replace(/\\n/g, '\n') as string
Expand Down

0 comments on commit f4f8085

Please sign in to comment.