Skip to content

zksync-sso-connector-export 0.4.0-beta.2

Install from the command line:
Learn more about npm packages
$ npm install @matter-labs/zksync-sso-connector-export@0.4.0-beta.2
Install via package.json:
"@matter-labs/zksync-sso-connector-export": "0.4.0-beta.2"

About this version

zksync-sso-wagmi-connector

This package exports the ZKsync SSO connector with embedded Era Test Node support, eliminating the need to manually import and configure the era-test-node chain.

Installation

npm install zksync-sso-wagmi-connector
# or
pnpm add zksync-sso-wagmi-connector
# or
yarn add zksync-sso-wagmi-connector

Usage

Simple Usage (with embedded Era Test Node)

The connector now automatically includes the Era Test Node (chain ID 260) configuration:

import { createConfig, http } from "@wagmi/core";
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";

const wagmiConfig = createConfig({
  chains: [eraTestNode], // Era test node is now exported directly
  connectors: [
    zksyncSsoConnector({
      authServerUrl: "http://localhost:3002/confirm",
      session: {
        feeLimit: parseEther("0.1"),
        transfers: [
          {
            to: "0x55bE1B079b53962746B2e86d12f158a41DF294A6",
            valueLimit: parseEther("0.1"),
          },
        ],
      },
    }),
  ],
  transports: {
    [eraTestNode.id]: http(),
  },
});

Advanced Configuration

You can disable the automatic Era Test Node inclusion if you want to configure chains manually:

import { zksyncSsoConnector } from "zksync-sso-wagmi-connector";
import { zksyncSepoliaTestnet } from "@wagmi/core/chains";

const connector = zksyncSsoConnector({
  includeEraTestNode: false, // Disable automatic era-test-node inclusion
  authServerUrl: "https://auth.zksync.dev/confirm",
  // ... other options
});

const wagmiConfig = createConfig({
  chains: [zksyncSepoliaTestnet], // Use your own chain configuration
  connectors: [connector],
  transports: {
    [zksyncSepoliaTestnet.id]: http(),
  },
});

Exported Items

zksyncSsoConnector(options)

Enhanced ZKsync SSO connector that automatically includes the era-test-node configuration.

Options

All options from the original ZksyncSsoConnectorOptions plus:

  • includeEraTestNode?: boolean - Whether to include the era-test-node chain automatically. Defaults to true.

eraTestNode

The Era Test Node chain definition (chain ID 260) that can be used directly in your wagmi configuration.

{
  id: 260,
  name: "ZKsync Era Test Node",
  nativeCurrency: {
    name: "Ether",
    symbol: "ETH",
    decimals: 18,
  },
  rpcUrls: {
    default: {
      http: ["http://localhost:8011"],
    },
  },
  testnet: true,
  // ... additional ZKsync-specific configuration
}

Migration from Previous Version

If you were previously importing the era-test-node chain manually:

Before:

import { zksyncSsoConnector } from "zksync-sso/connector";
import { zksyncInMemoryNode } from "@wagmi/core/chains";

const wagmiConfig = createConfig({
  chains: [zksyncInMemoryNode],
  connectors: [zksyncSsoConnector(options)],
  // ...
});

After:

import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";

const wagmiConfig = createConfig({
  chains: [eraTestNode], // Now exported directly from the connector package
  connectors: [zksyncSsoConnector(options)], // Same API, but with era-test-node embedded
  // ...
});

Requirements

  • Node.js 18+
  • ZKsync SSO SDK
  • Viem ^2.30.0
  • Wagmi ^2.0.0

License

MIT

Details


Assets

  • zksync-sso-connector-export-0.4.0-beta.2.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0