Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/docs/sdk/event-payloads/contexts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,35 @@ The `type` and default key is `"culture"`.

: _Optional_. The timezone of the locale. For example, `Europe/Vienna`.

## Screenshot Context

The Screenshots Context carries information about screenshots that have been included with an
event as attachments.

The `type` and default key is `"screenshot"`.

Each key of `screenshot` should match the filename of an attachment. An SDK can
include any additional information to helps determine the state of an windows
and which screenshot is most relevant to the event.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we introduce a more opinionated schema for now?

type ScreenshotContext = {
  [key: string]: {
    focus?: boolean;
    errored?: boolean;
  } & Record<string, unknown>,
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this info going in the attachment envelope header?
Somehow being made available to the attachment, the data is used by the thumbnail component in the UI


Example:

```json
{
"contexts": {
"screenshot": {
"screenshot.png": {
"focus": true
},
"screenshot-1.png": {
"focus": false,
"errored": true,
}
}
}
}
```

## Examples

The following example illustrates the contexts part of the <Link to="/sdk/event-payloads/">event payload</Link> and omits other attributes for simplicity.
Expand Down