API reference › @evolu/common › Type › Id

const Id: brand(
  "Id",
  String,
  (value: string) =>
    value.length === 22 && Base64Url.from.parent(value).ok
      ? ok()
      : err<IdError>({ type: "Id", value }),
  formatIdError,
);

Defined in: packages/common/src/Type.ts:10173

Evolu Id: 16 bytes encoded as a 22-character Base64Url.

Like Nano ID, it is compact and URL-safe. Unlike Nano ID's 21-character default, an Evolu Id is the canonical Base64Url encoding of a full 128-bit value, so it round-trips directly between its string and byte representations with idToIdBytes and idBytesToId. These helpers use native Base64 APIs.

createId is the privacy-preserving default. Use createIdFromString for stable mappings from external identifiers, or createIdAsUuidv7 only when insertion locality is worth exposing the creation time encoded in the identifier.