Using Reown (WalletConnect) with ZKsync

Learn how to use Reown (WalletConnect) to create React apps that interact with contracts on ZKsync.

This guide outlines how to use Reown (WalletConnect) to create apps that interact with contracts on ZKsync.

What you'll learn:

  • How to use Reown (WalletConnect) with wagmi
GitHub

Tools:

  • - walletconnect
  • - reown
  • - wagmi
guidewalletconnectreownfrontend
Last Updated: Dec 22, 2025

Using Reown (formerly WalletConnect) with ZKsync Era is fast and easy. Below is a quick example to get you started.

Reown's Appkit integrates with the Wagmi library, offering a suite of React Hooks to streamline your dapp development. This enables effortless message signing, smart contract interactions, and additional functionalities.

Don't have a project ID? Head over to Reown Cloud and create a new project now! This is a requirement for using Reown.

You can see examples below for React, Vue, and vanilla TypeScript:

Installation

npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem @tanstack/react-query

You can find more details about the installation in the Reown documentation.

Implementation

You can find an example implementation below for a React app:

src/App.tsx
import { createAppKit } from '@reown/appkit/react';
import { useAccount, WagmiProvider } from 'wagmi';
import {
  zksync,
  zksyncSepoliaTestnet,
  zksyncInMemoryNode,
  zksyncLocalNode,
  type AppKitNetwork,
} from '@reown/appkit/networks';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';

// 0. Setup queryClient
const queryClient = new QueryClient();

// 1. Get projectId from https://cloud.reown.com
const projectId = 'YOUR_PROJECT_ID';

// 2. Create a metadata object - optional
const metadata = {
  name: 'AppKit',
  description: 'AppKit Example',
  url: 'http://localhost:5173', // origin must match your domain & subdomain
  icons: ['https://avatars.githubusercontent.com/u/179229932'],
};

// 3. Set the networks
const networks: [AppKitNetwork, ...AppKitNetwork[]] = [
  zksync,
  zksyncSepoliaTestnet,
  zksyncInMemoryNode,
  zksyncLocalNode,
];

// 4. Create Wagmi Adapter
const wagmiAdapter = new WagmiAdapter({
  networks,
  projectId,
  ssr: true,
});

// 5. Create Apptkit
createAppKit({
  adapters: [wagmiAdapter],
  networks,
  projectId,
  metadata,
  features: {
    analytics: true, // Optional - defaults to your Cloud configuration
  },
});

export function AppKitProvider({ children }: { children: React.ReactNode }) {
  return (
    <WagmiProvider config={wagmiAdapter.wagmiConfig}>
      <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
    </WagmiProvider>
  );
}

const Connect = () => {
  const { address } = useAccount();
  return (
    <>
      <div style={{ width: '100vw', display: 'grid', placeItems: 'center' }}>
        <appkit-button />
      </div>
      <p>
        {address && (
          <>
            <b>Address:</b> {address}
          </>
        )}
      </p>
    </>
  );
};

const App = () => {
  return (
    <AppKitProvider>
      <Connect />
    </AppKitProvider>
  );
};

export default App;

Installation

npm install @reown/appkit @reown/appkit-adapter-wagmi @tanstack/vue-query @wagmi/vue viem

You can find more details about the installation in the Reown documentation.

Implementation

You can find an example implementation below for a Vue app:

src/App.vue
<script lang="ts" setup>
import { createAppKit } from '@reown/appkit/vue';
import { zksync, type AppKitNetwork } from '@reown/appkit/networks';
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';

// 1. Get projectId from https://dashboard.reown.com
const projectId = 'YOUR_PROJECT_ID';

// 2. Create a metadata object
const metadata = {
  name: 'AppKit',
  description: 'AppKit Example',
  url: 'https://example.com', // origin must match your domain & subdomain
  icons: ['https://avatars.githubusercontent.com/u/179229932'],
};

// 3. Set the networks
const networks: [AppKitNetwork, ...AppKitNetwork[]] = [zksync];

// 4. Create Wagmi Adapter
const wagmiAdapter = new WagmiAdapter({
  networks,
  projectId,
});

// 5. Create the modal
createAppKit({
  adapters: [wagmiAdapter],
  networks,
  projectId,
  metadata,
  features: {
    analytics: true, // Optional - defaults to your Cloud configuration
  },
});
</script>

<template>
  <appkit-button />
</template>

Installation

npm install @reown/appkit @reown/appkit-adapter-wagmi wagmi viem

You can find more details about the installation in the Reown documentation.

Implementation

You can find an example implementation below for a vanilla TypeScript app:

src/reown.ts
import { createAppKit } from '@reown/appkit';
import { zksync } from '@reown/appkit/networks';
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';

export function setupReown() {
  // 1. Get a project ID at https://dashboard.reown.com
  const projectId = 'YOUR_PROJECT_ID';

  const networks = [zksync];

  // 2. Set up Wagmi adapter
  const wagmiAdapter = new WagmiAdapter({
    projectId,
    networks,
  });

  // 3. Configure the metadata
  const metadata = {
    name: 'AppKit',
    description: 'AppKit Example',
    url: 'https://example.com', // origin must match your domain & subdomain
    icons: ['https://avatars.githubusercontent.com/u/179229932'],
  };

  // 3. Create the modal
  const modal = createAppKit({
    adapters: [wagmiAdapter],
    networks: [zksync],
    metadata,
    projectId,
    features: {
      analytics: true, // Optional - defaults to your Cloud configuration
    },
  });

  // 4. Trigger modal programaticaly
  const openConnectModalBtn = document.getElementById('open-connect-modal');
  const openNetworkModalBtn = document.getElementById('open-network-modal');

  openConnectModalBtn?.addEventListener('click', () => modal.open());
  openNetworkModalBtn?.addEventListener('click', () => modal.open({ view: 'Networks' }));
}
src/main.ts
import { setupReown } from './reown.ts';

document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
  <div>
    <appkit-button />
  </div>
`;

setupReown();

You can find more information about how to integrate the Reown Appkit in the Reown documentation.


Made with ❤️ by the ZKsync Community