Function: createDeidContext()
createDeidContext(
spec):DeidContext
Create a DeidContext from consumer-held key material. The key is coerced to bytes and stored only in the module-private registry - never on the returned handle.
Parameters
spec
The key, optional date-shift seed, optional patient scope, and offset bound.
Returns
An opaque, self-redacting context.
Throws
DeidError with code DEID_NO_KEY if the key (or an explicit seed) is empty.
Example
import { createDeidContext } from "@cosyte/deid";
const ctx = createDeidContext({ key: "consumer-secret", patientId: "patient-1" });