Catalog npm
Back to packageRELEASE DETAILS

0.0.0-20250312201716

npm

@0xsequence/react-connect

Connect package for Sequence Web SDK

sequencewalletweb-sdk
Published12 Mar 2025
Direct dependencies27
Transitive dependenciesNot calculated

README

Current package documentation

Sequence Web SDK 🧰

Sequence Web SDK 🧰 is a library enabling developers to easily integrate web3 wallets in their app. It is based on wagmi and supports all wagmi features.

  • Connect via social logins eg: facebook, google, discord, etc...! 🔐🪪
  • Connect to popular web3 wallets eg: walletConnect, metamask ! 🦊 ⛓️
  • Full-fledged embedded wallet for coins and collectibles 👛 🖼️ 🪙
  • Fiat onramp 💵 💶 💴 💷

View the demo! 👀

Quick Start

Installing the Library

@0xsequence/react-connect is the core package. Any extra modules require this package to be installed first. To install this package:

npm install @0xsequence/react-connect wagmi ethers@6.13.0 viem 0xsequence @tanstack/react-query
# or
pnpm install @0xsequence/react-connect wagmi ethers@6.13.0 viem 0xsequence @tanstack/react-query
# or
yarn add @0xsequence/react-connect wagmi ethers@6.13.0 viem 0xsequence @tanstack/react-query

Setting up the Library

The 'easy' way

  • createConfig(walletType, options) method is used to create your initial config and prepare sensible defaults that can be overridden

walletType is either 'waas' or 'universal'

interface CreateConfigOptions {
  appName: string
  projectAccessKey: string
  chainIds?: number[]
  defaultChainId?: number
  disableAnalytics?: boolean
  defaultTheme?: Theme
  position?: ModalPosition
  signIn?: {
    logoUrl?: string
    projectName?: string
    useMock?: boolean
  }
  displayedAssets?: Array<{
    contractAddress: string
    chainId: number
  }>
  ethAuth?: EthAuthSettings

  wagmiConfig?: WagmiConfig // optional wagmiConfig overrides

  waasConfigKey: string
  enableConfirmationModal?: boolean

  walletConnect?:
    | boolean
    | {
        projectId: string
      }

  google?:
    | boolean
    | {
        clientId: string
      }

  apple?:
    | boolean
    | {
        clientId: string
        rediretURI: string
      }

  email?:
    | boolean
    | {
        legacyEmailAuth?: boolean
      }
}
import { SequenceConnect, createConfig } from '@0xsequence/react-connect'

import Content from './components/Content'

const config = createConfig('waas', {
  projectAccessKey: '<your-project-access-key>',
  chainIds: [1, 137],
  defaultChainId: 1,
  appName: 'Demo Dapp',
  waasConfigKey: '<your-waas-config-key>',

  google: {
    clientId: '<your-google-client-id>'
  },

  apple: {
    clientId: '<your-apple-client-id>',
    redirectUrl: '...'
  },

  walletConnect: {
    projectId: '<your-wallet-connect-id>'
  }
})

function App() {
  return (
    <SequenceConnect config={config}>
      <Content />
    </SequenceConnect>
  )
}

Need more customization?

React apps must be wrapped by a Wagmi client and the SequenceWalletProvider components. It is important that the Wagmi wrapper comes before the Sequence Web SDK wrapper.

import Content from './components/Content'
import { SequenceConnectProvider, getDefaultConnectors, getDefaultChains } from '@0xsequence/react-connect'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createConfig, http, WagmiProvider } from 'wagmi'
import { mainnet, polygon, Chain } from 'wagmi/chains'

const projectAccessKey = 'xyz'

const chains = getDefaultChains(/* optional array of chain ids to filter */)

const transports = {}

chains.forEach(chain => {
  transports[chain.id] = http()
})

const connectors = getDefaultConnectors('universal', {
  projectAccessKey,
  appName: 'demo app',
  defaultChainId: 137,

  walletConnect: {
    projectId: '<your-wallet-connect-project-id>'
  }
})

const config = createConfig({
  chains,
  transports,
  connectors
})

const queryClient = new QueryClient()

function App() {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <SequenceConnectProvider>
          <Content />
        </SequenceConnectProvider>
      </QueryClientProvider>
    </WagmiProvider>
  )
}

Opening the Sign in Modal

Wallet selection is done through a modal which can be called programmatically.

import { useOpenConnectModal } from '@0xsequence/react-connect'
import { useDisconnect, useAccount } from 'wagmi'

const MyReactComponent = () => {
  const { setOpenConnectModal } = useOpenConnectModal()

  const { isConnected } = useAccount()

  const onClick = () => {
    setOpenConnectModal(true)
  }

  return <>{!isConnected && <button onClick={onClick}>Sign in</button>}</>
}

Hooks

useOpenConnectModal

Use the useOpenConnectModal to change to open or close the connection modal.

import { useOpenConnectModal } from '@0xsequence/react-connect'
// ...
const { setOpenConnectModal } = useOpenConnectModal()
setOpenConnectModal(true)

useTheme

Use the useTheme hook to get information about the current theme, such as light or dark, or set it to something else.

import { useTheme } from '@0xsequence/react-connect'
const { theme, setTheme } = useTheme()

setTheme('light')

Customization

The SequenceConnectProvider wrapper can accept an optional config object.

The settings are described in more detailed in the Sequence Web SDK documentation.


  const connectConfig =  {
    defaultTheme: 'light',
    position: 'top-left',
    signIn: {
      logoUrl: 'https://logo-dark-mode.svg',
      projectName: 'my app',
    },
    // limits the digital assets displayed on the assets summary screen
    displayedAssets: [
      {
        contractAddress: ethers.ZeroAddress,
        chainId: 137,
      },
      {
        contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
        chainId: 137
      }
    ],
    readOnlyNetworks: [10],
  }

  <SequenceConnectProvider config={connectConfig}>
    <App />
  <SequenceConnectProvider>

Packages

PackageDescriptionDocs
@0xsequence/react-connectCore package for Sequence Web SDKRead more
@0xsequence/react-walletEmbedded wallets for viewing and sending coins and collectiblesRead more
@0xsequence/react-checkoutCheckout modal with fiat onrampRead more
example-reactExample application showing sign in, wallet and checkoutRead more

Local Development

The React example can be used to test the library locally.

  1. pnpm install
  2. From the root folder, run pnpm build to build the packages.
  3. From the root folder, run pnpm dev:react or pnpm dev:next to run the examples.

What to do next?

Now that the core package is installed, you can install the embedded wallet or take a look at the checkout.

LICENSE

Apache-2.0

Copyright (c) 2017-present Horizon Blockchain Games Inc. / https://horizon.io

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 33

Native requirements
27 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xsequence/api
Environment
{
  "local_name": "@0xsequence/api",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/auth
Environment
{
  "local_name": "@0xsequence/auth",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/core
Environment
{
  "local_name": "@0xsequence/core",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/design-system
Environment
{
  "local_name": "@0xsequence/design-system",
  "alias": false,
  "peer_metadata": null
}
^2.0.9runtime
@0xsequence/ethauth
Environment
{
  "local_name": "@0xsequence/ethauth",
  "alias": false,
  "peer_metadata": null
}
^1.0.0runtime
@0xsequence/indexer
Environment
{
  "local_name": "@0xsequence/indexer",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/metadata
Environment
{
  "local_name": "@0xsequence/metadata",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/network
Environment
{
  "local_name": "@0xsequence/network",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/provider
Environment
{
  "local_name": "@0xsequence/provider",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/utils
Environment
{
  "local_name": "@0xsequence/utils",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
@0xsequence/waas
Environment
{
  "local_name": "@0xsequence/waas",
  "alias": false,
  "peer_metadata": null
}
>= 2.2.13runtime
clsx
Environment
{
  "local_name": "clsx",
  "alias": false,
  "peer_metadata": null
}
^2.1.1runtime
fuse.js
Environment
{
  "local_name": "fuse.js",
  "alias": false,
  "peer_metadata": null
}
^6.6.2runtime
motion
Environment
{
  "local_name": "motion",
  "alias": false,
  "peer_metadata": null
}
^12.3.1runtime
uuid
Environment
{
  "local_name": "uuid",
  "alias": false,
  "peer_metadata": null
}
^10.0.0runtime
0xsequence
Environment
{
  "local_name": "0xsequence",
  "alias": false,
  "peer_metadata": null
}
^2.2.13development
@tanstack/react-query
Environment
{
  "local_name": "@tanstack/react-query",
  "alias": false,
  "peer_metadata": null
}
^5.37.1development
@types/uuid
Environment
{
  "local_name": "@types/uuid",
  "alias": false,
  "peer_metadata": null
}
^9.0.8development
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
6.13.0development
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.12.0development
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^2.14.11development
@0xsequence/react-hooks
Environment
{
  "local_name": "@0xsequence/react-hooks",
  "alias": false,
  "peer_metadata": null
}
0.0.0-20250312201716development
0xsequence
Environment
{
  "local_name": "0xsequence",
  "alias": false,
  "peer_metadata": null
}
^2.2.13peer
@databeat/tracker
Environment
{
  "local_name": "@databeat/tracker",
  "alias": false,
  "peer_metadata": null
}
^0.9.3peer
@react-oauth/google
Environment
{
  "local_name": "@react-oauth/google",
  "alias": false,
  "peer_metadata": null
}
^0.11.1peer
@tanstack/react-query
Environment
{
  "local_name": "@tanstack/react-query",
  "alias": false,
  "peer_metadata": null
}
^5.0.0peer
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^6.13.0peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
>= 17 < 19peer
react-apple-signin-auth
Environment
{
  "local_name": "react-apple-signin-auth",
  "alias": false,
  "peer_metadata": null
}
^1.1.0peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
>= 17 < 19peer
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.0.0peer
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^2.14.11peer
@0xsequence/react-hooks
Environment
{
  "local_name": "@0xsequence/react-hooks",
  "alias": false,
  "peer_metadata": null
}
0.0.0-20250312201716peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-JxapDOUX4CvpHcDu0eqwQL4yZc5CN89Ln2vZGAgXJv9H9EqktcmTSurb5Pttaw+EyhgBGWCO8DOzwMTNiXTeDQ==",
  "shasum": "9f1b2fe25b51cfc4d9919a0409e701b8099a8144",
  "tarball": "https://registry.npmjs.org/@0xsequence/react-connect/-/react-connect-0.0.0-20250312201716.tgz",
  "fileCount": 845,
  "unpackedSize": 1335898,
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEYCIQD+m7XSu1gMJ36lQ60RkbStRS41Whtvhc0oAWfuPrjc0QIhAIwwdFM6BF6ARFETm23P50sy1LwXTFpMWUZt/TjHuKbU"
    }
  ]
}

Repository

PENDING
0xsequence/web-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:55 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:e78a52f3421cd9b6e525c8fd8fca0e218ec423946ca1f08ac6f61eb93e4a69e8

Other collected versions

View all collected versions →