@spritz-finance/react-native-secure-elements
v1.0.9
Published
[![NPM](https://img.shields.io/npm/v/@spritz-finance/react-native-secure-elements.svg)](https://www.npmjs.com/package/@spritz-finance/react-native-secure-elements)
Downloads
2
Readme
@spritz-finance/react-native-secure-elements
Introduction
Official react native components for Spritz Finance.
Install
npm install --save @spritz-finance/react-native-secure-elements
or
yarn add @spritz-finance/react-native-secure-elements
Usage
import React from 'react'
import { SpritzCard, Environment } from '@spritz-finance/react-native-secure-elements'
const App = () => {
const [tokens, setTokens] = React.useState<{ apiKey: string; renderSecret: string}>(null)
React.useEffect(() => {
// Get the renderSecret for the SpritzCard from the api
// Pass in the renderSecret along with the users api key
setTokens({
apiKey: 'ak_MzY5YWJ...',
renderSecret: 'U2FsdGVkX18bLYGYL...'
}
})
if (!tokens) return null
return (
<SpritzCard
environment={Environment.Staging}
apiKey={tokens.apiKey}
renderSecret={tokens.renderSecret}
onCopyText={(text) => console.log('onCopyText', text)}
onDetailsLoaded={() => console.log('Card details loaded')}
/>
)
}
export default App