1.2.1 • Published 9 months ago

@publicsquare/elements-react v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

PublicSquare React Elements

Version Downloads

A thin React wrapper for PublicSquare JavaScript Elements SDK.

Installation

Using Node Package Manager

npm install --save @publicsquare/elements-react

Using Yarn

yarn add @publicsquare/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 usePublicSquare hook with parameters:

import {
  PublicSquareProvider,
  CardElement,
  usePublicSquare,
} from '@publicsquare/publicsquare-react';

const App = () => {
  return (
    <PublicSquareProvider apiKey={apiKey}> // Publishable API Key
      <MyComponent />
    </PublicSquareProvider>
  );
};

const MyComponent = () => {
  const { publicSquare } = usePublicSquare();

  return <CardElement id="cardInput" />;
};
1.2.1

9 months ago

1.2.0

9 months ago