Skip to content

createBrowserCurvyConfig

Creates a CurvyConfig with defaults for a browser application.

Import

ts
import { createBrowserCurvyConfig } from "@0xcurvy/curvy-sdk/config";

Usage

ts
const config = await createBrowserCurvyConfig({
  environment: "mainnet",
});

The constructor uses IndexedDB storage, enables session key and JWT restoration, selects sharded note synchronization, and registers the config as the ambient default.

Returns

Promise<CurvyConfig>

Parameters

Accepts the same parameters as createCurvyConfig. Browser defaults can be overridden explicitly.

storage

  • Type: CurvyStorage | undefined
  • Default: IndexedDBStorage
ts
const config = await createBrowserCurvyConfig({
  storage, 
});

enableKeystore

  • Type: boolean
  • Default: true
ts
const config = await createBrowserCurvyConfig({
  enableKeystore: false, 
});

notesSyncEngine

  • Type: "global" | "sharded"
  • Default: "sharded"
ts
const config = await createBrowserCurvyConfig({
  notesSyncEngine: "global", 
});

Lifecycle

Call destroyConfig when the application instance is disposed.