npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sdk-v2-passkeywallet

v2.6.4

Published

sdk passkeyring to connect smart account

Readme

sdk-v2-passkeywallet

This docs is for React.js and Next.js, if you are using Javacript, please refer to sdk-v2-passkeywallet for JavaScript

Introduction:

The sdk-v2-passkeywallet SDK is built on React.js, provides a straightforward way to connect wallets using passkeys, allowing interaction with smart accounts. It is pre-configured with AppKit (web3modal), making it easy to integrate into your projects.

Prerequisites:

Before installing the SDK, ensure you have set up AppKit (web3modal).

⚠ If you have already set it up, skip this step.

📚 AppKit Documentation

If you prefer a video tutorial, please click below 👇

IMAGE ALT TEXT HERE

# NOTE:
// when you are in the modal creation step of web3modal,
// ensure enableEIP6963 = true and enableInjected = true

// Example
const modal = createAppKit({
  ...yourConfig,
  enableEIP6963: true,
  enableInjected: true,
});

Installation

Install the SDK using npm:

npm install --save sdk-v2-passkeywallet

or using yarn:

yarn add sdk-v2-passkeywallet

Usage

// MUST HAVE - Use this in the first file to run (index.js)

import React from "react";
import { PasskeyProvider } from "sdk-v2-passkeywallet";

const App = ({ children }) => {
  return <PasskeyProvider>{children}</PasskeyProvider>;
};

export default App;

#Issue

If you have completed the above steps but your wallet is not listed in the AppKit (web3modal) modal

=> Please update AppKit( web3modal) to the latest version.

#Supported chains

Ethereum:         '0x1'
OP Mainnet:       '0xa'
BNB Smart Chain:  '0x38'
Polygon:          '0x89'
Arbitrum One:     '0xa4b1'
Base:             '0x2105'

#API

| Name | Description | ----------------------------- | ----------------------- | PasskeyProvider | Component Passkey Provider | infoWallet | Wallet information | isWeb3Injected | Check if Web3 Injected Provider is supported

#API Details

PasskeyProvider

PasskeyProvider is a wrapper that supports using wallets.

| Property | Description | Required |Attribute | ----------------------------- | ----------------------- | -------------------|---------- | config | Config Passkey Provider |Optional |rpcUrl


import { PasskeyProvider } from "sdk-v2-passkeywallet";

  //Example
  <PasskeyProvider
        config={{
          rpcUrl: {
            137: "http://rpc...",
          },
        }}
      >
        {/*CODE HERE */}
  </PasskeyProvider>

infoWallet

Information about the wallet.

| Property | Attribute | ----------------------------- | ------------------------------------------------------------- | infoWallet | ndns | | name | | icon | | id

import { infoWallet } from "sdk-v2-passkeywallet";

  //example
  <div>
    <img src={infoWallet.icon} width={20} height={20} />
    <div>{infoWallet.name}</div>
    <div>{infoWallet.id}</div>
    <div>{infoWallet.ndns}</div>
  </div>

isWeb3Injected

Function to check if the browser supports Web3 provider injection.

| Function | result | ----------------------------- | ------------------------------------------------------------- | isWeb3Injected() | boolean

import { isWeb3Injected } from "sdk-v2-passkeywallet";

  //Example
  <div>
    {!isWeb3Injected() && <ButtonConnectWallet />}
  </div>

 // The way to create a ButtonConnectWallet will be in Advanced

#Advanced

Custom Button to Connect Wallet

#Required: To customize the button to connect the wallet, you can set up one of the below providers.

#1 - Documentation Provider AppKit ( web3modal) - recommended

Or

#2 - Documentation Provider wagmi

#Target:

- Connect wallet to browsers that do not support injected providers.
- If you are using Provider AppKit: Resolve the issue of using an older version without updating to the latest version.
- If you are using Provider wagmi: You only need a simple setup with wagmi.
=> Then follow these steps to create a custom connect button.
// Step 1: Create a button to connect
import React from "react";
import { infoWallet } from "sdk-v2-passkeywallet";
import { useConnect, useConnectors, useSwitchChain } from "wagmi";

const ButtonConnectWallet = () => {
  const { connect } = useConnect();

  const { switchChainAsync } = useSwitchChain();
  const connectors = useConnectors();

  const handleConnect = async () => {
    const chainId = 137;

    await switchChainAsync({ chainId: chainId });// Switch to the chain you want to connect

    connectors.forEach((connector) => {
      if (connector.id === infoWallet.rdns) {
        connect({
          connector,
          chainId: chainId,
        });
      }
    });
  };

  return (
    <button
      onClick={async () => {
        await handleConnect();
      }}
      style={{
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        padding: "10px",
        borderRadius: "5px",
        cursor: "pointer",
        gap: "10px",
      }}
    >
      <img src={infoWallet.icon} width={20} height={20} />
      <div>{infoWallet.name}</div>
    </button>
  );
};

export default ButtonConnectWallet;

// Step 2: Use the connect button

import React from "react";
import { isWeb3Injected } from "sdk-v2-passkeywallet";
import ButtonConnectWallet from "./ButtonConnectWallet";// step 1

const YourComponent = () => {

  return (
    <>
         <ButtonConnectWallet />
    </>
  );
};

export default YourComponent;