@parafin/react-parafin-elements
v2.5.7
Published
React component for integrating with Parafin
Downloads
543
Readme
react-parafin-elements
React component for integrating with Parafin
Install
With npm
npm install --save @parafin/react-parafin-elements
With yarn
yarn add @parafin/react-parafin-elements
Documentation
Please refer to the official Parafin docs.
Examples
Using pre-built component
import React, { useCallback } from 'react'
import { ParafinElements, ParafinBusinessDetails } from 'react-parafin-elements'
const App = () => {
// generate your Parafin token here
const token = getParafinToken(businessId)
const onOptIn = useCallback(async (businessId: string) => {
// generate your business details here
const businessDetails: ParafinBusinessDetails = { ... }
return businessDetails
}, [])
return (
// only initialize Elements once you have fetched a token
<ParafinElements
token={token}
environment="development | production"
onOptIn={onOptIn}
product="capital | card"
/>
)
}
export default App