Catalog npm
PACKAGE EXPLORERView in registry

@0xkey-io/react-wallet-kit

npm

The easiest and most powerful way to integrate 0xkey's Embedded Wallets into your React applications.

0xkey
Versions collected6
Direct dependencies30From release 0.3.1
Last observed21 Oct, 09:01 UTC

README

Current package documentation

@0xkey-io/react-wallet-kit

The @0xkey-io/react-wallet-kit is a powerful SDK that allows you to integrate ZeroXKey's Embedded Wallets into your React applications. It provides a set of UI components and easy-to-use functions, all exported from a hook, enabling you to quickly build secure embedded wallet experiences.

Getting started

To learn how to setup your ZeroXKey organization and configure the Auth Proxy, check out our Getting Started guide!

Installation

You can use @0xkey-io/react-wallet-kit in any React based web application.

For this guide, let's create a new Next.js app. If you already have an existing app, you don't need to do this.

npx create-next-app@latest

Now, install the ZeroXKey React Wallet Kit package:

npm install @0xkey-io/react-wallet-kit
pnpm add @0xkey-io/react-wallet-kit
yarn add @0xkey-io/react-wallet-kit

Provider

Wrap your app with the ZeroXKeyProvider component, and import "@0xkey-io/react-wallet-kit/styles.css" to include styles for the UI components.

With Next.js App Router, keep app/layout.tsx as a server component and create a separate app/providers.tsx client wrapper. This is necessary if you want to pass callbacks (e.g., onError), which must be defined in a client component.

"use client";

import {
  ZeroXKeyProvider,
  ZeroXKeyProviderConfig,
} from "@0xkey-io/react-wallet-kit";

const zeroXKeyConfig: ZeroXKeyProviderConfig = {
  organizationId: process.env.NEXT_PUBLIC_ORGANIZATION_ID!,
  authProxyConfigId: process.env.NEXT_PUBLIC_AUTH_PROXY_CONFIG_ID!,
};

export function Providers({ children }: { children: React.ReactNode }) {
  return <ZeroXKeyProvider config={zeroXKeyConfig}>{children}</ZeroXKeyProvider>;
}

In case anything goes wrong, let's add an onError callback to the ZeroXKeyProvider to catch any errors that may occur.

<ZeroXKeyProvider
  config={zeroXKeyConfig}
  callbacks={{
    onError: (error) => console.error("ZeroXKey error:", error),
  }}
>

Then, use the Providers component to wrap your app in app/layout.tsx.

import "@0xkey-io/react-wallet-kit/styles.css";
import "./globals.css";
import Providers from "./providers";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <Providers>{children}</Providers>
      </body>
    </html>
  );
}

Why this pattern?

  • Callbacks (and other interactive bits) must be declared in a client component.
  • Keeping layout.tsx as a server component maintains optimal rendering and avoids making your entire app client-side unnecessarily.
  • Centralizing ZeroXKey setup in app/providers.tsx keeps configuration, styles, and callbacks in one place.

Quick authentication

The easiest way to handle authentication is using the handleLogin function from the useZeroXKey hook. This will automatically show a modal with all the authentication methods you've enabled in your dashboard.

import { useZeroXKey } from "@0xkey-io/react-wallet-kit";

function LoginButton() {
  const { handleLogin } = useZeroXKey();

  return <button onClick={handleLogin}>Login / Sign Up</button>;
}

For more information, check out our docs!

Downloads & popularity

Awaiting observations

No metric observations yet

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

Versions 6

Collected releases
VersionPublishedDirect dependenciesOpen version
0.3.1Registry latest15 Oct 202630
0.2.115 Oct 202629
0.3.03 Jul 202630
0.2.023 Jun 202629
0.1.122 May 202629
0.1.022 May 202629

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0xkey-io/sdk-js

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:01 UTC

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

Record identity

package:bbbe3b2677d1b51b94af128ed8fdee9ba1ae39c1b5ab85604a378689e41e373d