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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@onkey/sdk

v0.1.8

Published

Self-hosted Web3 authentication SDK

Readme

@onkey/sdk

Official SDK for integrating Onkey's MPC-based authentication and ERC-4337 account abstraction into React and Next.js applications.

Requirements

  • React 16.8+ or Next.js 12+
  • Node.js 16+
  • A running Onkey backend service
  • Bundler and Paymaster RPC endpoints (e.g., Pimlico, Alchemy)

Installation

pnpm add @onkey/sdk

Quick Start

This example shows the minimal setup needed to authenticate users:

import { OnkeyProvider, useOnkey } from '@onkey/sdk';
import { baseSepolia } from 'viem/chains';

// 1. Configure and wrap your app
const config = {
  backendUrl: 'http://localhost:3001',
  chain: baseSepolia,
  bundlerUrl: 'https://api.pimlico.io/v2/xxx/rpc?apikey=KEY',
  paymasterUrl: 'https://api.pimlico.io/v2/xxx/rpc?apikey=KEY',
  factoryAddress: '0x...',
  entryPointAddress: '0x0000000071727De22E5E9d8BAf0edAc6f37da032',
};

export default function App({ children }: { children: React.ReactNode }) {
  return <OnkeyProvider config={config}>{children}</OnkeyProvider>;
}

// 2. Use the hook in your components
function LoginForm() {
  const { login, verifyOTP, address, isAuthenticated } = useOnkey();

  const handleLogin = async () => {
    const methodId = await login('[email protected]');
    // Send OTP code to user
  };

  const handleVerify = async (code: string) => {
    await verifyOTP('[email protected]', code, methodId);
    console.log('Authenticated as:', address);
  };

  return isAuthenticated ? <p>Welcome!</p> : <p>Please sign in</p>;
}

Configuration

| Option | Type | Required | Description | |------|-----|---------|------------| | backendUrl | string | Yes | Your Onkey backend service endpoint | | chain | Chain | Yes | Target EVM chain (e.g., baseSepolia from viem/chains) | | bundlerUrl | string | Yes | ERC-4337 bundler RPC endpoint | | paymasterUrl | string | Yes | Paymaster RPC endpoint for gasless transactions | | factoryAddress | string | Yes | OnkeyAccountFactory contract address | | entryPointAddress | string | Yes | ERC-4337 EntryPoint contract address |

Authentication

Use the useOnkey() hook to access authentication methods:

const {
  login,           // (email: string) => Promise<string> (methodId)
  verifyOTP,       // (email, code, methodId) => Promise<void>
  logout,          // () => Promise<void>
  address,         // string | null
  isAuthenticated, // boolean
  isLoading,       // boolean
} = useOnkey();

Examples

Send a Gasless Transaction

const { sendTransaction } = useOnkey();

const txHash = await sendTransaction({
  to: '0x...',
  value: '1000000000000000000', // 1 ETH in wei
  data: '0x',
});

Logout User

const { logout } = useOnkey();
await logout();

Important: Storage & Browser Environment

The SDK uses IndexedDB for encrypted key shares and localStorage for tokens:

  • ⚠️ Do not import or use the SDK on the server side (SSR, API routes)
  • Use Next.js 13+ 'use client' directive or dynamic imports with ssr: false
  • Storage initialization only happens in the browser

More Documentation

For full API documentation, advanced usage, and platform concepts, see: https://github.com/somehowliving/onkey

License

MIT - See LICENSE

Support & Resources

License

MIT - See LICENSE file for details


Version: Check package.json for current version
Updated: December 2025