Socket
Socket
Sign inDemoInstall

@front-finance/link

Package Overview
Dependencies
0
Maintainers
6
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.3 to 1.1.4

dist/cjs/FrontConnection.d.ts

22

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc