@credova/elements-react
v1.1.2
Published
Credova React Elements
Downloads
20
Readme
Credova React Elements
A thin React wrapper for Credova JavaScript Elements SDK.
Installation
Using Node Package Manager
npm install --save @credova/elements-react
Using Yarn
yarn add @credova/elements-react
Documentation
For a complete list of options and examples, please refer to our React Elements SDK docs
Usage
Initialization
Initializing the SDK is done via calling the useCredova
hook with parameters:
import {
CredovaProvider,
CardElement,
useCredova,
} from '@credova/credova-react';
const App = () => {
return (
<CredovaProvider apiKey={apiKey}> // Publishable API Key
<MyComponent />
</CredovaProvider>
);
};
const MyComponent = () => {
const { credova } = useCredova();
return <CardElement id="cardInput" />;
};