![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@front-finance/link
Advanced tools
JS library for integrating with Front Finance
As of Dec 7, 2023 this package is no longer maintained and has been superseded by a new version. For the latest features, improvements, and bug fixes, please use our updated package: mesh-web-sdk.
We encourage all users to migrate to the new package for continued support and updates.
With npm
:
npm install --save @front-finance/link
With yarn
yarn add @front-finance/link
Link token should be obtained from the GET /api/v1/linktoken
endpoint. Api reference for this request is available here. Request must be preformed from the server side because it requires the client secret. You will get the response in the following format:
{
"content": {
"linkToken": "{linktoken}"
},
},
"status": "ok",
"message": ""
}
You can use linkToken
value from this response to open the popup window with openLink
method.
import { createFrontConnection } from '@front-finance/link';
// ...
const frontConnection = createFrontConnection({
clientId: '<Your Front Finance Client Id>',
onBrokerConnected: (brokerData: FrontPayload) => {
// use broker account data
},
onExit: (error?: string) => {
if (error) {
// handle error
} else {
// ...
}
}
To open authentication link provided by Front Finance Integration API you need to call openLink
method:
frontConnection.openLink(linkToken)
ℹ️ See full source code example at react-example/src/ui/Front.tsx
import {
createFrontConnection,
FrontConnection,
FrontPayload
} from '@front-finance/link'
// ...
const [frontConnection, setFrontConnection] = useState<FrontConnection | null>(
null
)
useEffect(() => {
setFrontConnection(createFrontConnection(options))
}, [])
useEffect(() => {
if (authLink) {
frontConnection?.openLink(linkToken)
}
}, [frontConnection, authLink])
return <></>
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.
ℹ️ See src/types/index.ts for exported types.
createFrontConnection
argumentskey | type | description |
---|---|---|
clientId | string | Keys from https://dashboard.getfront.com/company/keys page |
onBrokerConnected | (payload: FrontPayload) => void | Callback called when users connects their accounts |
onExit | ((error?: string | undefined) => void) | undefined | Called if connection not happened |
onTransferFinished | (payload: TransferFinishedPayload) => void | Callback called when a crypto transfer is executed |
onEvent | (payload: FrontEventType) => void | A callback function that is called when various events occur within the Front iframe |
accessTokens | IntegrationAccessToken[] | An array of integration access tokens |
createFrontConnection
return valuekey | 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 |
You can use broker tokens to perform requests to get current balance, assets and execute transactions. Full API reference can be found here.
TypeScript definitions for @front-finance/link
are built into the npm package.
FAQs
Front Finance accounts connection client lib
We found that @front-finance/link demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.