Skip to content

Commit f050a8b

Browse files
committed
feat: throw error when neither client token nor client id is defined
1 parent 916e146 commit f050a8b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/harmonix.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ export const createHarmonix = async (
3232
resolveHarmonixEvent(evt, harmonix.options)
3333
)
3434

35+
if (!process.env.HARMONIX_CLIENT_TOKEN) {
36+
throw new Error(
37+
'Client token is required. Please provide it in the environment variable HARMONIX_CLIENT_TOKEN.'
38+
)
39+
}
40+
if (!harmonix.options.clientId && !process.env.HARMONIX_CLIENT_ID) {
41+
throw new Error(
42+
'Client ID is required. You can provide it in the configuration file or in the environment variable HARMONIX_CLIENT_ID.'
43+
)
44+
}
3545
harmonix.client = initCient(harmonix.options)
3646
registerCommands(
3747
harmonix,

0 commit comments

Comments
 (0)