Skip to main content

Overview

Feature flags are set on the featureFlags option when you create a Portal instance. They control optional behavior such as signing performance and backup options. You do not need to change your signing or wallet code when enabling flags—the SDK adapts automatically.

Enabling feature flags

Pass featureFlags in the Portal constructor:
import Portal from '@portal-hq/web'

const portal = new Portal({
  rpcConfig: {
    'eip155:1': 'https://mainnet.infura.io/v3/YOUR_KEY',
  },
  apiKey: 'YOUR_PORTAL_CLIENT_API_KEY',
  featureFlags: {
    usePresignatures: true,
  },
})

Available flags

usePresignatures

  • Type: boolean
  • Default: false
  • Description: When enabled, the SDK uses presignatures to improve signing latency. You do not call any presignature APIs yourself; the SDK generates presignatures in the background and uses them automatically when you sign (e.g. via portal.request() or portal.rawSign()).
What presignatures do Presignatures pre-compute part of the MPC signing protocol ahead of time. When the user triggers a sign (EVM transaction or raw sign), the SDK consumes one presignature if available and completes the signature faster. If no presignature is available, the SDK falls back to normal signing. Behavior is transparent to your app. When to enable Enable usePresignatures when you want lower latency on EVM signing without changing your integration. The SDK fills a small buffer after wallet creation or recovery and replenishes it as presignatures are used. Limitations
  • Applies only to SECP256K1 (EVM) signing. Solana (ED25519) signing is unchanged.
  • Presignatures are single-use; the SDK manages creation and consumption for you.
Example
const portal = new Portal({
  rpcConfig: { 'eip155:1': 'https://...' },
  apiKey: 'YOUR_API_KEY',
  featureFlags: {
    usePresignatures: true,
  },
})

// Signing uses presignatures automatically when available
const signature = await portal.request({
  chainId: 'eip155:1',
  method: 'personal_sign',
  params: [message, address],
})

Reference

For all constructor options and the featureFlags property, see the Web SDK Reference.