Skip to content

Commit

Permalink
Rid 3300 Add fallback on serverUrl -> serverPath (#12)
Browse files Browse the repository at this point in the history
* RID-3300 export DRSConfigOptions, support sdkLoadUrl option

* RID-3300 Add DRSConfigOptions documentation, bump major version

* RID-3300 remove clientId from options

* RID-3300 type fix, temp version for tests

* RID-3300 Add CHANGELOG to package, bump version to major release (serverPath->serverUrl breaking change)

* RID-3300 remove redundant spacing

* RID-3300 Update CHANGELOG.md

* RID-3300 add serverPath option key as deprat
cated

* RID-3300 change changelog

* RID-3300 fix typo

* RID-3300 improve changelog typings

* RID-3300 update demo-app with new version

* RID-3300 add fallbackk on serverPath

---------

Co-authored-by: Shaul Engler <[email protected]>
  • Loading branch information
adidim-transmit and ShaulTransmit authored Jun 18, 2023
1 parent 6ff2161 commit 627dfa6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Version 1.0.16
## Version 1.0.17
1. Renamed `serverPath` optional param to `serverUrl`, mark `serverPath` as deprecated.
2. Export new `DRSConfigOptions` interface for the Provider component.
3. Add new optional param - `sdkLoadUrl` - an alternative URL to load the SDK from for 1st-party integration (*This option overrides the `DRSConfigOptions/sdkVersion` option).
Expand Down
4 changes: 2 additions & 2 deletions package/TSAccountProtectionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type ErrHandler = (err: any) => void;
* @deprecate
* Please use `serverUrl` instead
*/
serverPath?: string;
serverPath?: string;

/**
* A base URL to use for submission of device telemetry and actions, used for 1st-party integration
Expand Down Expand Up @@ -143,7 +143,7 @@ const buildProviderState = (clientId: string, options?: DRSConfigOptions): Provi
return {
initialized: new Promise((res) => undefined), // making default promise in pending state
clientId,
serverUrl: options?.serverUrl ?? 'https://collect.riskid.security/',
serverUrl: options?.serverUrl ?? (options?.serverPath || 'https://collect.riskid.security/'),
sdkVersion,
sdkLoadUrl: options?.sdkLoadUrl ?? generateSdkUrl(sdkVersion),
...(options?.userId && { userId: options.userId }),
Expand Down
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@transmitsecurity/riskid-reactjs-ts",
"version": "1.0.16",
"version": "1.0.17",
"license": "SEE LICENSE IN LICENSE",
"module": "./dist/index.es.js",
"main": "./dist/index.cjs.js",
Expand Down

0 comments on commit 627dfa6

Please sign in to comment.