Tweed Docs
  • Welcome to Tweed
    • What Can Tweed Do?
  • Getting Started
    • Embedded Wallets | WaaS
    • Token Checkout | Payments
      • Flow of Funds: Purchase to Settlement
      • Token Checkout
      • Legacy Token Checkout
        • Basic Checkout Integration
        • Checkout + WaaS + Auth
        • Features
          • Payment links
          • Whitelist
          • Flow of Funds
          • Apple & Google Pay
          • AML & KYC Policy Overview
  • Developer Tools
    • Tweed SDKs
      • core-react
        • useAuth
        • useWallet
        • useTweed
        • usePayments
        • useWeb3
      • core-js
      • core-vue
      • Payments SDKs (v1)
        • Frontend SDKs (Payments)
        • Backend SDK (Payments)
        • How to set up your smart contract for Tweed
        • Tezos chain considerations
    • Management Dashboard
      • Create platform
      • Create application
        • UI Customization
    • Webhooks
      • Checkout Webhooks
    • API
      • API (V1)
      • API (V2)
        • Authorization
        • API reference
          • Contracts
            • Add
            • Add contract function
            • Contract
          • Payouts
            • Add
            • Payout
          • Items
            • Add
            • All
              • Contract
                • Count
              • Payout
                • Count
          • Assets
            • Blockchain
            • All
              • Blockchains
          • Blockchains
            • Multiple
            • Native asset
          • Audit event mappings
          • Platform webhooks
            • Set active
          • Tickets
        • Specification
    • External Integrations
      • Wagmi connector
      • Onramp to Crypto
    • Example Projects
    • Supported Blockchains
    • Pricing
  • Products
    • WaaS
    • Payments
Powered by GitBook
On this page
  • Install
  • Setup
  • Tweed Provider
  • Hooks
  1. Developer Tools
  2. Tweed SDKs

core-react

tweed React SDK

PreviousTweed SDKsNextuseAuth

Last updated 11 months ago

Fully compatible with and offers complete support for

Install

npm i @paytweed/core-js

Setup

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

Install by package manager, install the from the .

Ensure you have an application set up on the tweed

paytweed/core-react
npm public registry
dashboard

useAuth

Manage user authentication with functions such as connect, logout, and retrieve access token.

useTweed

Manage your Tweed SDK integration using the useTweed hook, which includes the setPaletteMode function and the SDK's loading state.

useWeb3

This hook is your gateway to the Web3 world. Use it to obtain the ethereumProvider and begin interacting with the blockchain, such as signing transactions.

useAuth
useTweed
useWeb3
React v18
TypeScript
npm: @paytweed/core-reactnpm
Logo
react logo