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.
@meshconnect/web-link-sdk
Advanced tools
Readme
A client-side JS library for integrating with Mesh Connect
With npm
:
npm install --save @meshconnect/web-link-sdk
With yarn
yarn add @meshconnect/web-link-sdk
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 { createLink } from '@meshconnect/web-link-sdk';
// ...
const linkConnection = createLink({
clientId: '<Your Mesh Connect Client Id>',
onIntegrationConnected: (data: LinkPayload) => {
// 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:
linkConnection.openLink(linkToken)
ℹ️ See full source code example at react-example/src/ui/Link.tsx
import {
createLink,
Link,
LinkPayload
} from '@meshconnect/web-link-sdk'
// ...
const [linkConnection, setLinkConnection] = useState<Link | null>(
null
)
useEffect(() => {
setLinkConnection(createLink(options))
}, [])
useEffect(() => {
if (authLink) {
linkConnection?.openLink(linkToken)
}
}, [linkConnection, authLink])
return <></>
After successfull authentication on the Link session, the popup will be closed and the broker tokens will be passed to the onIntegrationConnected
function.
Link
instance will check if URL contains query parameters, load broker tokens and fire the events.
ℹ️ See src/types/index.ts for exported types.
createLink
argumentskey | type | description |
---|---|---|
clientId | string | Keys from https://dashboard.getfront.com/company/keys page |
onIntegrationConnected | (payload: LinkPayload) => 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: LinkEventType) => void | A callback function that is called when various events occur within the Front iframe |
accessTokens | IntegrationAccessToken[] | An array of integration access tokens |
createLink
return valuekey | type | description |
---|---|---|
openLink | (linkToken: string) => Promise<void> | Opens the Link UI popup |
closeLink | () => Promise<void> | Closes the Link UI popup |
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 @meshconnect/web-link-sdk
are built into the npm package.
FAQs
A client-side JS library for integrating with Mesh Connect
The npm package @meshconnect/web-link-sdk receives a total of 719 weekly downloads. As such, @meshconnect/web-link-sdk popularity was classified as not popular.
We found that @meshconnect/web-link-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.