@front-finance/link
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "@front-finance/link", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Front Finance accounts connection client lib", | ||
"main": "./src/index.ts", | ||
"module": "./src/index.ts", | ||
"types": "./src/index.ts", | ||
"type": "module", | ||
"license": "MIT", | ||
@@ -23,2 +27,13 @@ "repository": "https://github.com/FrontFin/front-b2b-link.git", | ||
"dependencies": {}, | ||
"scripts": { | ||
"build": "rimraf dist && yarn build:esm && yarn build:cjs && yarn copy", | ||
"build:esm": "tsc --outDir dist", | ||
"build:cjs": "tsc --module commonjs --outDir dist/cjs", | ||
"typecheck": "tsc --noEmit", | ||
"lint": "eslint **/*.ts", | ||
"copy": "node ./tools/copy", | ||
"publish:npm": "yarn build && cd dist && yarn publish --access public", | ||
"test": "jest", | ||
"test:cov": "jest --ci --coverage" | ||
}, | ||
"jest": { | ||
@@ -38,6 +53,3 @@ "preset": "ts-jest", | ||
} | ||
}, | ||
"main": "cjs/index.js", | ||
"module": "index.js", | ||
"types": "index.d.ts" | ||
} | ||
} |
@@ -19,5 +19,5 @@ # @front-finance/link | ||
### Getting connection link | ||
### Getting Link token | ||
Connection link should be obtained from the GET `/api/v1/cataloglink` endpoint. Api reference for this request is available [here](https://integration-api.getfront.com/apireference#tag/Integrations/paths/~1api~1v1~1cataloglink/get). Request must be preformed from the server side because it requires the client secret. You will get the response in the following format: | ||
Link token should be obtained from the GET `/api/v1/linktoken` endpoint. Api reference for this request is available [here](https://integration-api.getfront.com/apireference#tag/Managed-Account-Authentication/paths/~1api~1v1~1linktoken/post). Request must be preformed from the server side because it requires the client secret. You will get the response in the following format: | ||
@@ -27,4 +27,4 @@ ```json | ||
"content": { | ||
"url": "https://web.getfront.com/broker-connect?auth_code={authCode}", | ||
"iFrameUrl": "https://web.getfront.com/b2b-iframe/{clientId}/broker-connect?auth_code={authCode}" | ||
"linkToken": "{linktoken}" | ||
}, | ||
}, | ||
@@ -36,3 +36,3 @@ "status": "ok", | ||
You can use `iFrameUrl` from this response to open the popup window with `openPopup` method. | ||
You can use `linkToken` value from this response to open the popup window with `openLink` method. | ||
@@ -63,6 +63,6 @@ ### Generating connection method | ||
To open authentication link rpovided by Front Finance Integration API you need to call `openPopup` method: | ||
To open authentication link provided by Front Finance Integration API you need to call `openLink` method: | ||
```tsx | ||
frontConnection.openPopup(authLink) | ||
frontConnection.openLink(linkToken) | ||
``` | ||
@@ -91,3 +91,3 @@ | ||
if (authLink) { | ||
frontConnection?.openPopup(authLink) | ||
frontConnection?.openLink(linkToken) | ||
} | ||
@@ -101,3 +101,3 @@ }, [frontConnection, authLink]) | ||
After successfull authentication on Front Finance user will be redirected back to provided callback URL. | ||
After successfull authentication on the Link session, the popup will be closed and the broker tokens will be passed to the `onBrokerConnected` function. | ||
`FrontConnection` instance will check if URL contains query parameters, load broker tokens and fire the events. | ||
@@ -122,6 +122,8 @@ | ||
| key | type | description | | ||
| ------------ | -------------------------------------- | ------------------- | | ||
| `openPopup` | `(iframeUrl: string) => Promise<void>` | Opens url in popup | | ||
| `closePopup` | `() => Promise<void>` | Closes popup window | | ||
| key | type | description | | ||
| ------------ | -------------------------------------- | ------------------------------ | | ||
| `openLink` | `(linkToken: string) => Promise<void>` | Opens the Link UI popup | | ||
| `closeLink` | `() => Promise<void>` | Closes the Link UI popup | | ||
| `o̶p̶e̶n̶P̶o̶p̶u̶p̶` | `(iframeUrl: string) => Promise<void>` | (OBSOLETE) Opens url in popup | | ||
| `c̶l̶o̶s̶e̶P̶o̶p̶u̶p̶` | `() => Promise<void>` | (OBSOLETE) Closes popup window | | ||
@@ -128,0 +130,0 @@ ### Using tokens |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
72433
34
1589
130
Yes
2
1