Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@privy-io/wagmi-connector

Package Overview
Dependencies
Maintainers
8
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@privy-io/wagmi-connector

A connector for Privy <> WAGMI.sh

latest
npmnpm
Version
0.1.13
Version published
Weekly downloads
472
-24.84%
Maintainers
8
Weekly downloads
 
Created
Source

WAGMI 🤝 Privy

wagmi-privy

This package only supports WAGMI V1. Please use our new @privy-io/wagmi library if you want to use WAGMI V2.

This plugin allows you to use WAGMI hooks with the Privy SDK. To integrate, simply wrap your components like so. (example next.js code below) (the below shows using goerli and mainnet)

The idea is that you first configure WAGMI as you would usually, and pass that to the PrivyWagmiConnector instead:

import {goerli, mainnet} from '@wagmi/chains';
import type {AppProps} from 'next/app';
import {configureChains} from 'wagmi';
import {publicProvider} from 'wagmi/providers/public';

import {PrivyProvider} from '@privy-io/react-auth';
import {PrivyWagmiConnector} from '@privy-io/wagmi-connector';

const configureChainsConfig = configureChains([mainnet, goerli], [publicProvider()]);

export default function App({Component, pageProps}: AppProps) {
  return (
    <PrivyProvider appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID as string}>
      <PrivyWagmiConnector wagmiChainsConfig={configureChainsConfig}>
        <Component {...pageProps} />
      </PrivyWagmiConnector>
    </PrivyProvider>
  );
}

Then, in your application, feel free to use WAGMI hooks like useAccount, useSignMessage, useEnsName, ...

Please do not use the useConnect hook to connect, but rather use {login} = usePrivy(). Privy controls the session and syncs it with WAGMI.

Keywords

authentication

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts