OptionalaccessOptionalattributesShortcut for access.attributes — advisory $attributes bag for soft gates.
OptionalclientShared TestClient. If omitted, the bench creates its own — two benches without a shared client are completely isolated, regardless of tag. Pass the same client to two benches to test tag-scoped visibility across a shared store.
OptionalcurrentShortcut for access.actor. Composed with grants / attributes.
OptionaldocumentsSubject documents seeded into the store.
OptionalexecutionDeclared execution context stamped (with the inferred runtime) on every
history entry the bench's engine calls append. Defaults to
{ kind: "test" }; override to exercise provenance rendering.
OptionalgrantsShortcut for access.grants. Composed with currentUser / attributes.
OptionalnowFreeze the bench clock at this ISO instant from construction, so
$now and every engine timestamp are deterministic. Equivalent to
calling BenchState.setNow immediately after createBench. Omit to
start on the wall clock (advance / setNow can freeze it later).
OptionalresourceCross-resource read routing for the bench engine scope — a served resource is also part of the declared surface for written refs. The escape hatch for resolver logic beyond same-store siblings; prefer CreateBenchOptions.serveResources, which is consulted first when both are given. Omit for single-resource benches.
OptionalserveSibling datasets the bench serves (and thereby declares) from its own
store — the common cross-resource case. Each listed resource routes to
a withConfig-derived handle over the bench's store, so reads reach it
and runtime-supplied refs into it are admitted. Only dataset
resources can be siblings of the bench's store; anything else needs
CreateBenchOptions.resourceClients.
OptionaltagEngine-scope environment partition. Defaults to BENCH_TAG. Pass
different tags to two benches sharing a client to assert partition
isolation; pass the same tag to assert visibility through a shared
partition.
The tag must be ASCII lowercase + digits + dashes, no leading dash, no dots — validated at construction.
OptionalworkflowWorkflow resource the bench's engine operates against. Mirrors
@sanity/client's ClientConfigResource. Defaults to
{ type: "dataset", id: "test.test" } so all bench-minted GDR
URIs read as dataset:test:test:<docId>.
The bench's default identity (actor + grants + optional attributes), registered as the default token on the fake client — the engine token-resolves it like production. Defaults to
ALL_ACCESS— wildcard user + wildcard grants. Pass a restrictive value to test denial paths.Mutually exclusive with the
currentUser/grants/attributesshortcuts (which compose into the same shape internally).