File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import { Actions } from './actions/actions';
3636import { Vault } from './vault/vault' ;
3737import { ConflictException } from './common/exceptions/conflict.exception' ;
3838import { CryptoProvider } from './common/crypto/crypto-provider' ;
39+ import { getEnv } from './common/utils/env' ;
3940
4041const VERSION = '8.0.0-beta.2' ;
4142
@@ -72,10 +73,7 @@ export class WorkOS {
7273 ) {
7374 if ( ! key ) {
7475 // process might be undefined in some environments
75- this . key =
76- typeof process !== 'undefined'
77- ? process ?. env . WORKOS_API_KEY
78- : undefined ;
76+ this . key = getEnv ( 'WORKOS_API_KEY' ) ;
7977
8078 if ( ! this . key ) {
8179 throw new NoApiKeyProvidedException ( ) ;
@@ -87,8 +85,8 @@ export class WorkOS {
8785 }
8886
8987 this . clientId = this . options . clientId ;
90- if ( ! this . clientId && typeof process !== 'undefined' ) {
91- this . clientId = process ?. env . WORKOS_CLIENT_ID ;
88+ if ( ! this . clientId ) {
89+ this . clientId = getEnv ( ' WORKOS_CLIENT_ID' ) ;
9290 }
9391
9492 const protocol : string = this . options . https ? 'https' : 'http' ;
You can’t perform that action at this time.
0 commit comments