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, backup options, and which MPC backend is used. 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, BackupMethods } from '@portal-hq/core'
import Keychain from '@portal-hq/keychain'
import GoogleDriveStorage from '@portal-hq/gdrive-storage'

const portal = new Portal({
  apiKey: 'YOUR_PORTAL_CLIENT_API_KEY',
  backup: {
    [BackupMethods.GoogleDrive]: new GoogleDriveStorage({ /* ... */ }),
  },
  gatewayConfig: 'https://mainnet.infura.io/v3/YOUR_INFURA_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 send-asset flows).
What presignatures do Presignatures pre-compute part of the MPC signing protocol ahead of time. When the user triggers a sign (EVM transaction, raw sign, or send asset), 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({
  apiKey: 'YOUR_PORTAL_CLIENT_API_KEY',
  backup: { /* ... */ },
  gatewayConfig: { /* ... */ },
  featureFlags: {
    usePresignatures: true,
  },
})

useEnclaveMPCApi

  • Type: boolean
  • Default: false
  • Description: Use the Enclave MPC API for signing instead of the standard MPC path. Signing runs in a server-side TEE (AWS Nitro Enclave), which can yield more consistent and often faster signing across devices.

enableSdkPerformanceMetrics

  • Type: boolean
  • Default: false
  • Description: Enables SDK performance metrics collection. Used for internal monitoring and debugging.

Reference

For the full FeatureFlags type and constructor options, see @portal-hq/core.