Skip to content

Commit

Permalink
feat: make Options.region optional
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Jun 17, 2024
1 parent 6a7b439 commit 48c8024
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/serverApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ export class FingerprintJsServerApiClient {
* @param {Options} options - Options for FingerprintJS server API client
*/
constructor(options: Readonly<Options>) {
if (!options.region) {
throw Error('Region is not set')
}

if (!options.apiKey) {
throw Error('Api key is not set')
}

this.region = options.region
this.region = options.region ?? Region.Global
this.apiKey = options.apiKey
this.authenticationMode = options.authenticationMode ?? AuthenticationMode.AuthHeader // Default auth mode is AuthHeader
this.fetch = options.fetch ?? fetch
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface Options {
/**
* Region of the FingerprintJS service server
*/
region: Region
region?: Region
/**
* Authentication mode
* Optional, default value is AuthHeader
Expand Down

0 comments on commit 48c8024

Please sign in to comment.