SDKsEvents
Event envelope
Event envelope
Every upward fact uses the compact augeo.event envelope. Gate listeners on spec and specversion.
Deduplicate deliveries on event.id.
Prerequisites
| Item | Requirement |
|---|---|
| Persona | loyalty-concierge only |
| Bundle global | window.AugeoChatSdkLoyaltyConcierge |
| Event name | augeo.event (AUGEO_EVENT) |
Read Events before you parse fields. Load the production loyalty bundle first.
Transport
The widget dispatches a bubbling composed CustomEvent named augeo.event. The envelope is event.detail.
subscribeAugeoEvents drops details that fail the compact envelope predicate.
const { AUGEO_EVENT, subscribeAugeoEvents, isAugeoEventEnvelope } =
window.AugeoChatSdkLoyaltyConcierge;
subscribeAugeoEvents(document, (event) => {
routeByType(event);
});
document.addEventListener(AUGEO_EVENT, (e) => {
const event = e.detail;
if (!isAugeoEventEnvelope(event)) return;
routeByType(event);
});Root fields
| Field | Required | Meaning |
|---|---|---|
spec | yes | Constant augeo.event |
specversion | yes | Constant 1.0 |
id | yes | Unique emission id |
type | yes | Dictionary event name |
typeversion | yes | Payload version for this type |
time | yes | Emission time in epoch milliseconds |
class | yes | observed or measured |
source | yes | { surface, instanceId } |
subject | no | Optional subject of the event |
gestureKey | no | Optional stable key for one member gesture |
correlation | yes | Optional join keys. Object may be empty |
data | yes | { occurrence, context } |
class is observed for a direct fact. measured marks a derivation.
Measured siblings mint a new id. They set correlation.causationId to the source id.
Source
| Field | Required | Meaning |
|---|---|---|
source.surface | yes | Originating UI surface |
source.instanceId | yes | Instance id of that surface |
Correlation
All correlation values are optional strings. Omit empty values.
| Field | Meaning |
|---|---|
conversationId | Active conversation or thread |
turnId | Turn inside the conversation |
slotId | Interaction slot |
effectId | Effect waiting for a host ack |
interactionId | Interaction for this gesture |
causationId | Id of the causing event |
Join acks on envelope id, not on these keys. See Acknowledgements.
Data
| Field | Required | Meaning |
|---|---|---|
data.occurrence | yes | Type-specific fields. See Event catalog |
data.context | yes | Shared context bags. Object may be empty |
Example
{
spec: 'augeo.event',
specversion: '1.0',
id: 'evt_01hexample',
type: 'com.augeo.conversation.message.sent',
typeversion: 1,
time: 1735689600000,
class: 'observed',
source: { surface: 'chatsdk', instanceId: 'conversation' },
correlation: {
conversationId: 'thr_1',
turnId: 'turn_1',
},
data: {
occurrence: {
messageId: 'msg_1',
inputMethod: 'typed',
charCount: 12,
},
context: {},
},
}- Gate on
specaugeo.eventandspecversion1.0. - Deduplicate on
id. - Switch on
typebefore you readdata.occurrence. - Inspect
classandcorrelation.causationIdfor measured siblings.
Related pages
| Topic | Page |
|---|---|
| Handling rules | Events |
| Names and occurrence fields | Event catalog |
| Host ack contract | Acknowledgements |
| JSON schema | Events v1 |
| Public helpers | API |
| Event capability options | Event options |
| Widget configuration | Configuration |
| Product scope | Overview |