Skip to content

Commit c4da4c0

Browse files
committed
feat(develop): Add page context
1 parent c35af5f commit c4da4c0

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

develop-docs/sdk/data-model/event-payloads/contexts.mdx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,42 @@ envelope endpoint.
778778
}
779779
```
780780

781+
## Page Context
782+
783+
Page context contains information about the page that the event occurred on.
784+
785+
`url`
786+
787+
: **Required.** The URL of the page that the event occurred on.
788+
789+
- Example: `https://sentry.io/issues?page=1`
790+
791+
`user_agent`
792+
793+
: _Optional_. The user agent of the page that the event occurred on.
794+
795+
- Example: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36`
796+
797+
`referer`
798+
799+
: _Optional_. The referer of the page that the event occurred on.
800+
801+
- Example: `https://sentry.io/`
802+
803+
### Example Page Context
804+
805+
```json
806+
{
807+
"contexts": {
808+
"page": {
809+
"url": "https://sentry.io/issues?page=1",
810+
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
811+
"referer": "https://sentry.io/"
812+
}
813+
}
814+
}
815+
```
816+
781817
## Response Context
782818

783819
Response context contains information about the HTTP response associated with the event.
@@ -829,7 +865,7 @@ The required field is `package` which should contain the package or framework wh
829865
"contexts": {
830866
"missing_instrumentation": {
831867
"package": "express",
832-
"javascript.is_cjs": true,
868+
"javascript.is_cjs": true
833869
}
834870
}
835871
}

develop-docs/sdk/data-model/event-payloads/request.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ sidebar_order: 8
44
---
55

66
The Request interface contains information on a HTTP request related to the
7-
event. In client SDKs, this can be an outgoing request, or the request that
8-
rendered the current web page. On server SDKs, this could be the incoming web
9-
request that is being handled.
7+
event. In client SDKs, this can be an outgoing request (use the [page context](../contexts/#page-context) to track the page that the request was made from).
8+
On server SDKs, this could be the incoming web request that is being handled.
109

1110
The data variable should only contain the request body (not the query string).
1211
It can either be a dictionary (for standard HTTP requests) or a raw request

0 commit comments

Comments
 (0)