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
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | API key for JAW services authentication |
| appName | string | No | Application name displayed to users |
| appLogoUrl | string | null | No | URL to application logo image |
| ens | string | No | ENS domain for issuing subnames |
| defaultChainId | number | No | Default blockchain network |
| preference | object | No | Advanced SDK behavior options |
| paymasters | Record<number, { url: string; context?: Record<string, unknown> }> | No | Custom paymaster configuration per chain |
Preference Options
The preference object contains advanced configuration:
| Option | Type | Default | Description |
|---|---|---|---|
| mode | Mode.CrossPlatform | Mode.AppSpecific | Mode.CrossPlatform | Authentication mode |
| serverUrl | string | JAW Server | Custom passkey server URL |
| showTestnets | boolean | false | Include testnet networks |
| uiHandler | UIHandler | undefined | Custom UI handler for app-specific mode |
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
- Wagmi Integration - Using with Wagmi
- Provider API - Direct provider methods
- Supported Networks - Available chains