Catalog npm
Back to packageRELEASE DETAILS

0.3.2

npm

@0xsequence/react-native-sdk

Sequence v3 React Native SDK

androidiosreact-native
Published2 Feb 2026
Direct dependencies42
Transitive dependenciesNot calculated

README

Current package documentation

@0xsequence/react-native-sdk

Sequence v3 React Native SDK for seamless web3 integration.

Installation

To get started, install the @0xsequence/react-native-sdk and its peer dependencies.

yarn add @0xsequence/react-native-sdk @0xsequence/dapp-client @0xsequence/wallet-core @0xsequence/wallet-primitives ox viem
yarn add expo-crypto expo-linking expo-secure-store expo-standard-web-crypto expo-web-browser react-native-mmkv react-native-nitro-modules react-native-url-polyfill

or

npm install @0xsequence/react-native-sdk @0xsequence/dapp-client @0xsequence/wallet-core @0xsequence/wallet-primitives ox viem
npm install expo-crypto expo-linking expo-secure-store expo-standard-web-crypto expo-web-browser react-native-mmkv react-native-nitro-modules react-native-url-polyfill

Usage

First, you need to wrap your application with the SequenceProvider. This provider manages the connection state and makes the Sequence context available to all child components.

1. Configure the SequenceProvider

In your main application file (e.g., App.tsx), import and wrap your components with SequenceProvider.

// App.tsx
import {
  SequenceProvider,
  type SequenceProviderConfig,
} from '@0xsequence/react-native-sdk';
import { arbitrumSepolia } from 'viem/chains';

// Configuration for the Sequence Provider
const config: SequenceProviderConfig = {
  walletUrl: 'https://v3.sequence-dev.app',
  // IMPORTANT: This must match the "scheme" in your app.json
  origin: 'rndemosequencev3://',
  projectAccessKey: 'YOUR_PROJECT_ACCESS_KEY', // Replace with your key
  defaultChainId: arbitrumSepolia.id,
};

export default function App() {
  return (
    <SequenceProvider config={config}>
      {/* Your application components */}
      <YourAppComponent />
    </SequenceProvider>
  );
}

Note: The origin in your config must match the scheme defined in your app.json to handle redirects correctly after a wallet action.

2. Use the useSequence Hook

The useSequence hook provides access to the wallet state and methods to interact with the user's wallet.

Here's a basic example of a component that handles connection and displays wallet information. You can optionally request permissions during the connection process to enable seamless transactions later.

// YourAppComponent.tsx
import { useSequence, Signers, Utils } from '@0xsequence/react-native-sdk';
import { View, Text, Button, ActivityIndicator, Alert } from 'react-native';
import { AbiFunction } from 'ox';
import { arbitrumSepolia } from 'viem/chains';

// Define the contract and function you want permission for
const nftContractAddress = '0xD25b37E2fB07f85E9ecA9d40FE3BcF60BA2dc57b';
const mint = AbiFunction.from(['function safeMint(address to)']);

// Construct the permissions object
const getPermissionsForNFTMint = (chainId: number) => {
  const deadline = BigInt(Math.floor(Date.now() / 1000) + 60 * 60 * 24); // 24 hours from now

  return {
    chainId: chainId,
    valueLimit: 0n,
    deadline,
    permissions: [
      Utils.PermissionBuilder.for(nftContractAddress).forFunction(mint).build(),
    ],
  };
};

export default function YourAppComponent() {
  const {
    isInitializing,
    isInitialized,
    walletAddress,
    chainId,
    connect,
    disconnect,
  } = useSequence();

  const handleConnect = async () => {
    try {
      await connect({
        loginMethod: 'google',
        // Request permission to mint an NFT when connecting
        explicitSession: getPermissionsForNFTMint(chainId),
      });
    } catch (e) {
      console.error(e);
      Alert.alert('Error', 'Failed to connect');
    }
  };

  if (isInitializing) {
    return <ActivityIndicator />;
  }

  return (
    <View>
      {!isInitialized ? (
        <Button
          title="Connect with Google and Get Mint Permission"
          onPress={handleConnect}
        />
      ) : (
        <View>
          <Text>Wallet Address: {walletAddress}</Text>
          <Button title="Disconnect" onPress={() => disconnect()} />
        </View>
      )}
    </View>
  );
}

API Reference

useSequence()

This hook returns the SequenceContextState object, which contains all the necessary state and methods for interacting with the SDK.

Connection State

  • isInitializing: boolean: True while the SDK is establishing its initial state.
  • isInitialized: boolean: True once the SDK is initialized and a session is restored or ready to be created.

Session Properties

  • walletAddress: string | null: The address of the connected wallet.
  • sessions: Session[]: An array of all active sessions for the current user.
  • loginMethod: string | null: The method used for logging in (e.g., 'google', 'passkey').
  • userEmail: string | null: The user's email if available.

Chain State

  • chainId: number: The currently selected chain ID.
  • setChainId: (chainId: number) => void: A function to update the active chain ID.

Core Functions

  • connect(options): Initiates the connection process.

    • options.loginMethod: The preferred login method ('google', 'email', 'passkey').
    • options.explicitSession: Request a specific explicit session upon connection. This allows for seamless transactions later without further user prompts.
  • disconnect(): Clears the current session and disconnects the user.

  • signMessage(message): Prompts the user to sign a standard string message. Returns a promise that resolves with the signature.

  • signTypedData(typedData): Prompts the user to sign an EIP-712 typed data structure.

  • sendTransaction(transactions): Initiates one or more transactions. The return value depends on whether the session has permissions for the transaction.

    • If permissioned: It may return feeOptions if the relayer requires a fee. The developer can then choose a fee and call the returned send function. If no fee is required, it sends the transaction directly.

    • If not permissioned: It redirects the user to the wallet for approval.

    • Returns: Promise<SendTransactionResult>

      // If no fee is required or if sent via wallet
      { isFeeRequired: false, txHash: HexString }
      
      // If a fee is required for a permissioned session
      {
        isFeeRequired: true,
        feeOptions: Relayer.FeeOption[],
        send: (feeOption) => Promise<HexString>
      }
      
  • addExplicitSession(explicitSessionConfig): Prompts the user to approve a new session with a specific set of permissions (e.g., for minting an NFT without being prompted every time).

  • hasPermission(transactions): Checks if the current session has sufficient permissions to execute the given transactions without requiring wallet approval. Returns Promise<boolean>.

Contributing

Troubleshooting

Build Errors (ERR_REQUIRE_ESM)

If you encounter an error similar to Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported while running the build script (yarn prepare), it is likely due to an incompatible Node.js version.

Solution: The build tooling for this project requires a modern version of Node.js that supports ES Modules in CommonJS files. Please ensure you are using Node.js v22.15.1 or higher.

It is highly recommended to use a version manager like nvm to easily switch between Node.js versions. You can install and switch to the required version by running:

nvm install 22.15.1
nvm use 22.15.1

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 58

Native requirements
42 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xsequence/dapp-client
Environment
{
  "local_name": "@0xsequence/dapp-client",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12development
@0xsequence/relayer
Environment
{
  "local_name": "@0xsequence/relayer",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12development
@0xsequence/wallet-core
Environment
{
  "local_name": "@0xsequence/wallet-core",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12development
@0xsequence/wallet-primitives
Environment
{
  "local_name": "@0xsequence/wallet-primitives",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.29.0development
@babel/eslint-parser
Environment
{
  "local_name": "@babel/eslint-parser",
  "alias": false,
  "peer_metadata": null
}
^7.28.4development
@commitlint/config-conventional
Environment
{
  "local_name": "@commitlint/config-conventional",
  "alias": false,
  "peer_metadata": null
}
^20.4.1development
@eslint/compat
Environment
{
  "local_name": "@eslint/compat",
  "alias": false,
  "peer_metadata": null
}
^2.0.2development
@eslint/eslintrc
Environment
{
  "local_name": "@eslint/eslintrc",
  "alias": false,
  "peer_metadata": null
}
^3.3.3development
@eslint/js
Environment
{
  "local_name": "@eslint/js",
  "alias": false,
  "peer_metadata": null
}
^9.39.2development
@evilmartians/lefthook
Environment
{
  "local_name": "@evilmartians/lefthook",
  "alias": false,
  "peer_metadata": null
}
^2.0.16development
@react-native/babel-preset
Environment
{
  "local_name": "@react-native/babel-preset",
  "alias": false,
  "peer_metadata": null
}
0.83.1development
@react-native/eslint-config
Environment
{
  "local_name": "@react-native/eslint-config",
  "alias": false,
  "peer_metadata": null
}
^0.83.1development
@release-it/conventional-changelog
Environment
{
  "local_name": "@release-it/conventional-changelog",
  "alias": false,
  "peer_metadata": null
}
^10.0.4development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^30.0.0development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.13.0development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^19.1.0development
commitlint
Environment
{
  "local_name": "commitlint",
  "alias": false,
  "peer_metadata": null
}
^20.4.1development
del-cli
Environment
{
  "local_name": "del-cli",
  "alias": false,
  "peer_metadata": null
}
^7.0.0development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^9.39.2development
eslint-config-prettier
Environment
{
  "local_name": "eslint-config-prettier",
  "alias": false,
  "peer_metadata": null
}
^10.1.8development
eslint-plugin-ft-flow
Environment
{
  "local_name": "eslint-plugin-ft-flow",
  "alias": false,
  "peer_metadata": null
}
^2.0.3development
eslint-plugin-prettier
Environment
{
  "local_name": "eslint-plugin-prettier",
  "alias": false,
  "peer_metadata": null
}
^5.5.5development
expo
Environment
{
  "local_name": "expo",
  "alias": false,
  "peer_metadata": null
}
~54.0.33development
expo-crypto
Environment
{
  "local_name": "expo-crypto",
  "alias": false,
  "peer_metadata": null
}
~15.0.8development
expo-linking
Environment
{
  "local_name": "expo-linking",
  "alias": false,
  "peer_metadata": null
}
~8.0.11development
expo-secure-store
Environment
{
  "local_name": "expo-secure-store",
  "alias": false,
  "peer_metadata": null
}
~15.0.8development
expo-standard-web-crypto
Environment
{
  "local_name": "expo-standard-web-crypto",
  "alias": false,
  "peer_metadata": null
}
~3.0.8development
expo-web-browser
Environment
{
  "local_name": "expo-web-browser",
  "alias": false,
  "peer_metadata": null
}
~15.0.10development
hermes-eslint
Environment
{
  "local_name": "hermes-eslint",
  "alias": false,
  "peer_metadata": null
}
^0.33.3development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^30.2.0development
ox
Environment
{
  "local_name": "ox",
  "alias": false,
  "peer_metadata": null
}
^0.12.0development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^3.8.1development
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
19.1.0development
react-native
Environment
{
  "local_name": "react-native",
  "alias": false,
  "peer_metadata": null
}
0.81.5development
react-native-builder-bob
Environment
{
  "local_name": "react-native-builder-bob",
  "alias": false,
  "peer_metadata": null
}
^0.40.17development
react-native-mmkv
Environment
{
  "local_name": "react-native-mmkv",
  "alias": false,
  "peer_metadata": null
}
^4.1.2development
react-native-nitro-modules
Environment
{
  "local_name": "react-native-nitro-modules",
  "alias": false,
  "peer_metadata": null
}
^0.33.2development
react-native-url-polyfill
Environment
{
  "local_name": "react-native-url-polyfill",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
release-it
Environment
{
  "local_name": "release-it",
  "alias": false,
  "peer_metadata": null
}
^19.2.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.9.3development
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.45.1development
@0xsequence/dapp-client
Environment
{
  "local_name": "@0xsequence/dapp-client",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12peer
@0xsequence/wallet-core
Environment
{
  "local_name": "@0xsequence/wallet-core",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12peer
@0xsequence/wallet-primitives
Environment
{
  "local_name": "@0xsequence/wallet-primitives",
  "alias": false,
  "peer_metadata": null
}
3.0.0-beta.12peer
expo
Environment
{
  "local_name": "expo",
  "alias": false,
  "peer_metadata": null
}
~54.0.33peer
expo-crypto
Environment
{
  "local_name": "expo-crypto",
  "alias": false,
  "peer_metadata": null
}
~15.0.8peer
expo-linking
Environment
{
  "local_name": "expo-linking",
  "alias": false,
  "peer_metadata": null
}
~8.0.11peer
expo-secure-store
Environment
{
  "local_name": "expo-secure-store",
  "alias": false,
  "peer_metadata": null
}
~15.0.8peer
expo-standard-web-crypto
Environment
{
  "local_name": "expo-standard-web-crypto",
  "alias": false,
  "peer_metadata": null
}
~3.0.8peer
expo-web-browser
Environment
{
  "local_name": "expo-web-browser",
  "alias": false,
  "peer_metadata": null
}
~15.0.10peer
ox
Environment
{
  "local_name": "ox",
  "alias": false,
  "peer_metadata": null
}
^0.12.0peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
*peer
react-native
Environment
{
  "local_name": "react-native",
  "alias": false,
  "peer_metadata": null
}
*peer
react-native-mmkv
Environment
{
  "local_name": "react-native-mmkv",
  "alias": false,
  "peer_metadata": null
}
^4.1.2peer
react-native-nitro-modules
Environment
{
  "local_name": "react-native-nitro-modules",
  "alias": false,
  "peer_metadata": null
}
^0.33.2peer
react-native-url-polyfill
Environment
{
  "local_name": "react-native-url-polyfill",
  "alias": false,
  "peer_metadata": null
}
^3.0.0peer
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.45.1peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-JsCMyAipOzHgkmXjEqV5R+667lLTumg3GtqfJbQYCmpNwh4IQK/uVRGgcuAOg3x8B89xJfL1p9MkgD3ov0p6DQ==",
  "shasum": "36cbb1e36e9e927b5ca1377df0b219efe8f35288",
  "tarball": "https://registry.npmjs.org/@0xsequence/react-native-sdk/-/react-native-sdk-0.3.2.tgz",
  "fileCount": 40,
  "unpackedSize": 82927,
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEYCIQCRioHHtW68absSQ7na1M29REe+bncKyMDewJi91QgclAIhAJWu2/MhkDbHdzMfUVP2j/eOVQ7MdJJP9G93NHY+K/KE"
    }
  ]
}

Repository

PENDING
0xsequence/react-native-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:4e91a0e958eb3438172d2ef26af553efd095f42f00b0c0fa7409d3df76e68127

Other collected versions

0.3.12 Feb0.3.02 Feb0.2.015 OctView all collected versions →