File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
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
@@ -71,11 +72,7 @@ export class WorkOS {
7172 readonly options : WorkOSOptions = { } ,
7273 ) {
7374 if ( ! key ) {
74- // process might be undefined in some environments
75- this . key =
76- typeof process !== 'undefined'
77- ? process ?. env . WORKOS_API_KEY
78- : undefined ;
75+ this . key = getEnv ( 'WORKOS_API_KEY' ) ;
7976
8077 if ( ! this . key ) {
8178 throw new NoApiKeyProvidedException ( ) ;
@@ -87,8 +84,8 @@ export class WorkOS {
8784 }
8885
8986 this . clientId = this . options . clientId ;
90- if ( ! this . clientId && typeof process !== 'undefined' ) {
91- this . clientId = process ?. env . WORKOS_CLIENT_ID ;
87+ if ( ! this . clientId ) {
88+ this . clientId = getEnv ( ' WORKOS_CLIENT_ID' ) ;
9289 }
9390
9491 const protocol : string = this . options . https ? 'https' : 'http' ;
You can’t perform that action at this time.
0 commit comments