core-react

tweed React SDK

Fully compatible with React v18 and offers complete support for TypeScript

Install

Install by package manager, install the paytweed/core-react from the npm public registry.

npm i @paytweed/core-js

Setup

Ensure you have an application set up on the tweed dashboard

Tweed Provider

Use the Tweed provider as a context for your React app. Wrap your application with the Tweed provider to enable access to the Tweed hook throughout your project. Make sure to pass the Tweed provider your applicationId and the list of chains you will be using in your project.

<TweedProvider>
import { Network, TweedProvider } from "@paytweed/core-react";

function App() {
  return (
    <>
      <TweedProvider
        applicationId="YOUR_APP_ID"
          options={{
          chains: [Network.POLYGON, Network.ETHEREUM]
          }}
      >
        <HomePage />
      </TweedProvider>

Hook parameters

  • REQUIRED string

  • options optional object optional array optional string optional object

Hooks

Last updated