Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@front-finance/frontfinance-rn-sdk
Advanced tools
Readme
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-react-native-sdk.
We encourage all users to migrate to the new package for continued support and updates.
With npm
:
npm install --save @front-finance/frontfinance-rn-sdk
With yarn
:
yarn add @front-finance/frontfinance-rn-sdk
💡 This package requires react-native-webview
to be installed in your project. Although it is listed as direct dependency, some times it is not installed automatically (This is a known npm issue). You should install it manually via following command in this case:
npm install --save react-native-webview@11.26.0
# or with yarn
yarn add react-native-webview@11.26.0
linkToken
The connection link token should be obtained from the Get link token endpoint. Request must be performed from the server side because it requires the client secret. You will get the response in the following format:
You should use content --> linkToken
from this response to run the FrontFinance
component.
here is an example http request using request
API in JS:
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/*+json',
'X-Client-Secret': 'XXXX', // replace with your client secret
'X-Client-Id': 'XXXX' // replace with your client id
},
body: '{"userId":"XXXX"}' // replace with your user id (could be user email or phone number)
};
const getLinkToken = async () => {
const response = await fetch('https://integration-api.getfront.com/api/v1/linktoken', options);
const json = await response.json();
return json?.content?.linkToken;
};
You will get a response in the following structure:
{
"content": {
"linkToken": "REQUESTED_LINK_TOKEN"
},
"status": "ok",
"message": "",
"errorType": ""
}
FrontFinance
componentimport React from 'react';
import {
FrontFinance,
FrontPayload,
TransferFinishedPayload,
TransferFinishedSuccessPayload,
TransferFinishedErrorPayload
} from '@front-finance/frontfinance-rn-sdk';
export const App = () => {
return (
<FrontFinance
linkToken={"YOUR_LINKTOKEN"}
onBrokerConnected={(payload: FrontPayload) => {
// use broker account data
}}
onTransferFinished={(payload: TransferFinishedPayload) => {
if (payload.status === 'success') {
const successPayload = payload as TransferFinishedSuccessPayload
// use transfer finished data
} else {
const errorPayload = payload as TransferFinishedErrorPayload
// handle transfer error
}
}}
onClose={() => {
// use close event
}}
onError={(err: string) => {
// use error message
}}
/>
)
}
export default App;
ℹ️ See full source code examples at examples/.
FrontFinance
component argumentskey | type | Required/Optional | description |
---|---|---|---|
url | string @deprecated (use linkToken instead) | required (if linkToken is not provided) | Connection catalog link |
linkToken | string | required | link token |
onBrokerConnected | (payload: FrontPayload) => void | optional | Callback called when users connects their accounts |
onTransferFinished | (payload: TransferFinishedPayload) => void | optional | Callback called when a crypto transfer is executed |
onError | (err: string) => void) | optional | Called if connection not happened. Returns an error message |
onClose | () => void | optional | Called at the end of the connection, or when user closed the connection page |
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/frontfinance-rn-sdk
are built into the npm package.
FAQs
Front Finance React Native SDK.
The npm package @front-finance/frontfinance-rn-sdk receives a total of 5 weekly downloads. As such, @front-finance/frontfinance-rn-sdk popularity was classified as not popular.
We found that @front-finance/frontfinance-rn-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.