Skip to content

Commit

Permalink
fix: clarify staging implementation (#26)
Browse files Browse the repository at this point in the history
* apply node_env correctly

* docs

* changeset
  • Loading branch information
mustofa-id authored May 31, 2024
1 parent 1cf5ec7 commit b8d7d30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-kiwis-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ssecd/ihs": patch
---

Clarify staging implementation
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ interface IHSConfig {
secretKey: string;

/**
* Mode environment API antara `development` ata `production`
* Mode environment API antara `development`, `staging`, atau `production`
*
* @default process.env.NODE_ENV || 'development'
*/
Expand Down
4 changes: 2 additions & 2 deletions src/ihs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IHSConfig {
secretKey: string;

/**
* Mode environment API antara `development` ata `production`
* Mode environment API antara `development`, `staging`, atau `production`
*
* @default process.env.NODE_ENV || 'development'
*/
Expand Down Expand Up @@ -87,7 +87,7 @@ export default class IHS {

private async applyUserConfig(): Promise<void> {
const defaultConfig: Readonly<IHSConfig> = {
mode: process.env['NODE_ENV'] === 'production' ? 'production' : 'development',
mode: (process.env['NODE_ENV'] as Mode) || 'development',
clientSecret: process.env['IHS_CLIENT_SECRET'] || '',
secretKey: process.env['IHS_SECRET_KEY'] || '',
kycPemFile: process.env['IHS_KYC_PEM_FILE'] || ''
Expand Down

0 comments on commit b8d7d30

Please sign in to comment.