API reference › @evolu/common › local‑first/Evolu › hasWrappedDeviceSecret

function hasWrappedDeviceSecret(
  appName: string & Brand<"UrlSafeString"> & Brand<"AppName">,
): Task<
  boolean,
  UnknownError,
  CreateDbWorkerDep &
    CreateBroadcastChannelDep &
    CreateMessageChannelDep &
    DevicePersistenceDep &
    LockManagerDep &
    ReloadAppDep &
    Partial<ConsoleDep> &
    Partial<CreateMemoryInstanceWorkerDep> &
    Partial<FlushSyncDep> &
    Partial<RequestPersistentStorageDep> &
    StoredWorkerDep
>;

Defined in: packages/common/src/local-first/Evolu.ts:2926

Whether the app has a stored WrappedDeviceSecret, without a prompt, such as to label a button "Create account" or "Unlock". A setup that stopped before storing it doesn't count, and where the platform keeps nothing, it's false. It fails with UnknownError when SQLite fails to read it or its database is refused. Like createEvoluApp, it stays pending while another build of the app keeps it waiting or the shared worker fails to load. See unlockWrappedDeviceSecret.

It reads without waiting for a setup running in another tab, which can store a secret right after, so don't use it to skip the warning before starting over; forgetWrappedDeviceSecret with onlyPending checks under the setup's lock.