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

1.4.0 • Public • Published

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" />;
};

Readme

Keywords

none

Package Sidebar

Install

npm i @publicsquare/elements-react

Weekly Downloads

82

Version

1.4.0

License

MIT

Unpacked Size

30.8 kB

Total Files

30

Last publish

Collaborators

  • bweber-psq
  • rlfrahmpsq