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

@okto_web3/wagmi-adapter

v1.0.0

Published

Wagmi Adapter for Okto SDK

Downloads

39

Readme

Okto Wagmi Adapter

This package provides an adapter for the Okto SDK to be used with the Wagmi library. It allows you to easily integrate Okto's authentication and wallet management features into your web3 applications. The connector is designed to work seamlessly with the Wagmi library, providing a simple and efficient way to manage user authentication and wallet connections.

Refer to the Okto SDK documentation for more information on how to use the Okto SDK.

Installation

npm i @okto_web3/wagmi-adapter@latest @okto_web3/react-sdk@latest

Setup

Configuration

Add okto connector to wagmi configuration.

Example

import { okto } from '@okto_web3/wagmi-adapter';
import { cookieStorage, createConfig, createStorage, http } from 'wagmi';
import { mainnet, optimism, polygon } from 'wagmi/chains';

export function getConfig() {
  return createConfig({
    chains: [polygon],
    connectors: [
      okto({
        environment: 'sandbox',
        clientPrivateKey: '0xprivatekey',
        clientSWA: '0xswa',
      }),
    ],
    storage: createStorage({
      storage: cookieStorage,
    }),
    ssr: true,
    transports: {
      [polygon.id]: http(),
    },
  });
}

declare module 'wagmi' {
  interface Register {
    config: ReturnType<typeof getConfig>;
  }
}
import { headers } from 'next/headers';
import type { ReactNode } from 'react';
import { cookieToInitialState } from 'wagmi';
import { getConfig } from '../wagmi';

export default async function RootLayout(props: { children: ReactNode }) {
  const initialState = cookieToInitialState(
    getConfig(),
    (await headers()).get('cookie'),
  );

  const [config] = useState(() => getConfig());
  const [queryClient] = useState(() => new QueryClient());

  return (
    <html lang="en">
      <body>
        <WagmiProvider config={config} initialState={initialState}>
          <QueryClientProvider client={queryClient}>
            {props.children}
          </QueryClientProvider>
        </WagmiProvider>
      </body>
    </html>
  );
}

Usage

Use wagmi as you normally would! Refer to the wagmi documentation for more information on how to use wagmi.

Schema

| Param | Description | Type | | ------------------ | ------------------------------- | --------- | | environment | Environement to use for the SDK | sandbox | | clientPrivateKey | Client private key | string | | clientSWA | Client SWA | string |


RainbowKit Integration

To use the Okto connector with RainbowKit, you can use the getOktoSdkConnector function to create a connector for the Okto SDK. This function takes an object with the following properties:

  • type: The type of Okto connector you want to create. This can be either 'google' or 'generic'. (More will be added in the future)
  • params: An object containing the Okto SDK parameters. This should include the environment, clientPrivateKey, and clientSWA properties.

Use the getOktoSdkConnector function to create a connectors object for RainbowKit. You can then pass this object to the connectors property of the RainbowKit configuration.

Refer to the RainbowKit documentation for more information on how to set up connectors.

Example

import { getOktoSdkConnector, OktoParameters } from '@okto_web3/wagmi-adapter';
import { connectorsForWallets } from '@rainbow-me/rainbowkit';
import { createConfig, http } from 'wagmi';
import { mainnet, optimism, polygon } from 'wagmi/chains';

const oktoParams: OktoParameters = {
  environment: 'sandbox',
  clientPrivateKey: '0xprivatekey',
  clientSWA: '0xswa',
};

// create a 'Social Login' group in rainbowkit config connectors list
const connectors = connectorsForWallets(
  [
    {
      groupName: 'Social Login',
      wallets: [
        getOktoSdkConnector({
          type: 'google',
          params: oktoParams,
        }),
        getOktoSdkConnector({
          type: 'generic',
          params: oktoParams,
        }),
      ],
    },
  ],
  {
    appName: 'My Okto Rainbowkit App',
    projectId: 'xxx',
  },
);

export const config = createConfig({
  chains: [mainnet, optimism, polygon],
  connectors: connectors,
  transports: {
    [mainnet.id]: http(),
    [optimism.id]: http(),
    [polygon.id]: http(),
  },
});