oc · docs
docs / documentation

@orangecheck/me-client


@orangecheck/me-client / FireEventOptions

Interface: FireEventOptions

Defined in: me-client/src/event.ts:38

Properties

PropertyTypeDescriptionDefined in
<a id="property-action_label"></a> action_label?stringHuman-readable action label that appears on the envelope. Optional but encouraged — it's what the user sees in their /me/activity ledger.me-client/src/event.ts:47
<a id="property-bearertoken"></a> bearerToken?stringThe forwarded user oc_session JWT (the token from the sign-in popup result). Identifies which user earns the cashback. Pass it per-call for stateless, concurrency-safe server-side firing — preferred over the process-global setBearerToken when your backend serves many users. A same-origin family integrator (*.ochk.io) can omit it; the oc_session cookie rides automatically.me-client/src/event.ts:76
<a id="property-idempotencykey"></a> idempotencyKey?stringIdempotency key (e.g. a UUID v7 per logical event). A retry with the same key returns the prior event rather than double-billing.me-client/src/event.ts:79
<a id="property-is_agent"></a> is_agent?booleanPer OCHK-V3-PLAN §7 phase-1 · when true, the event was fired by an oc-agent delegation rather than a human acting under their own session. The integrator's IntegratorEventConfig.agent block applies the override (or refuses · 422 agent_refused). Set this when an autonomous agent (oc-agent kind 30084 action envelope) is the source of the event. Don't set it for events the human user clicked themselves.me-client/src/event.ts:62
<a id="property-metadata"></a> metadata?Record&lt;string, unknown>Free-form metadata stored on the envelope. Public — anyone who GETs /api/envelope/<id> sees it. Don't put secrets here.me-client/src/event.ts:53
<a id="property-payment_amount_sats"></a> payment_amount_sats?numberFor percent_of_amount-priced subtypes, the underlying amount the fee is computed against. Required for those subtypes.me-client/src/event.ts:50
<a id="property-project_key"></a> project_keystringYour project_key (e.g. pk_live_yourcompany). Required.me-client/src/event.ts:40
<a id="property-signingsecret"></a> signingSecret?stringThe project's HMAC signing secret. When provided, the SDK signs the request with X-OC-Signature, authenticating the call as the INTEGRATOR. This is REQUIRED in live mode — without it the server 401s, because a user session alone proves a user, never the paying project. SERVER-SIDE ONLY: never ship this secret to a browser. Find/rotate it on the project Keys tab (/me/projects/<id>/keys).me-client/src/event.ts:69
<a id="property-subtype"></a> subtypeEventKeyBillable event key · a built-in subtype OR a custom key defined on your project catalog. Class + label are resolved server-side from the catalog.me-client/src/event.ts:43