Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Configuration

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

Usage

With Wagmi (Recommended)

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
serverUrlstringJAW ServerCustom passkey server URL
showTestnetsbooleanfalseInclude testnet networks
uiHandlerUIHandlerundefinedCustom UI handler for app-specific mode

See all preference options →

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' });

Related