Skip to content
LogoLogo

Configuration

Configuration options for the JAW SDK. These options apply to both the Wagmi connector and the direct provider.

Usage

import { jaw } from '@jaw.id/wagmi';
 
const connector = jaw({
  apiKey: 'your-api-key',
  appName: 'My DApp',
  appLogoUrl: 'https://my-dapp.com/logo.png',
  defaultChainId: 1,
  ens: 'myapp.eth',
  preference: {
    showTestnets: true,
  },
  paymasters: {
    1: { url: 'https://paymaster.example.com/mainnet' },
  },
});

With Provider Directly

import { JAW } from '@jaw.id/core';
 
const jaw = JAW.create({
  apiKey: 'your-api-key',
  appName: 'My DApp',
  appLogoUrl: 'https://my-dapp.com/logo.png',
  defaultChainId: 1,
  ens: 'myapp.eth',
  preference: {
    showTestnets: true,
  },
  paymasters: {
    1: { url: 'https://paymaster.example.com/mainnet' },
  },
});

Configuration Options

Core Parameters

ParameterTypeRequiredDescription
apiKeystringYesAPI key for JAW services authentication
appNamestringNoApplication name displayed to users
appLogoUrlstring | nullNoURL to application logo image
ensstringNoENS domain for issuing subnames
defaultChainIdnumberNoDefault blockchain network
preferenceobjectNoAdvanced SDK behavior options
paymastersRecord<number, { url: string; context?: Record<string, unknown> }>NoCustom paymaster configuration per chain

Preference Options

The preference object contains advanced configuration:

OptionTypeDefaultDescription
modeMode.CrossPlatform | Mode.AppSpecificMode.CrossPlatformAuthentication mode
uiHandlerUIHandlerundefinedUI handler for rendering dialogs (required when mode is Mode.AppSpecific)
showTestnetsbooleanfalseInclude testnet networks (see Supported Networks)
authTTLnumber86400Session cache TTL in seconds. Set to 0 to disable caching (require auth on every page load).

Learn more about authentication modes →

Return Value

Wagmi Connector

The jaw() function returns a Wagmi Connector that can be used in your wagmi config.

import { createConfig } from 'wagmi';
import { jaw } from '@jaw.id/wagmi';
 
const config = createConfig({
  connectors: [jaw({ apiKey: 'your-api-key' })],
  // ...
});

Provider

The JAW.create() function returns an object with:

provider

Type: ProviderInterface

An EIP-1193 compatible Ethereum provider for making RPC requests.

const jaw = JAW.create({ apiKey: 'your-api-key' });
 
const accounts = await jaw.provider.request({
  method: 'wallet_connect',
});

disconnect()

Type: () => Promise<void>

Method to disconnect the current session and clean up resources.

await jaw.disconnect();

Minimal Configuration

The only required option is apiKey:

// Wagmi
const connector = jaw({ apiKey: 'your-api-key' });
 
// Provider
const jaw = JAW.create({ apiKey: 'your-api-key' });