A thin React wrapper for Credova JavaScript Elements SDK.
Using Node Package Manager
npm install --save @credova/elements-react
Using Yarn
yarn add @credova/elements-react
For a complete list of options and examples, please refer to our React Elements SDK docs
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" />;
};