@spritz-finance/react-secure-elements
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

@spritz-finance/react-secure-elements

NPM

Introduction

Official react components for Spritz Finance.

Install

npm install --save @spritz-finance/react-secure-elements

or

yarn add @spritz-finance/react-secure-elements

Usage

import React from 'react'
import { SpritzCard, Environment } from '@spritz-finance/react-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

Readme

Keywords

none

Package Sidebar

Install

npm i @spritz-finance/react-secure-elements

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

6.16 kB

Total Files

7

Last publish

Collaborators

  • ohitslaurence
  • eliyahud