Skip to content

Commit 5169e7f

Browse files
committed
feat(develop): Add page context
1 parent d44f7d2 commit 5169e7f

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

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

+37-2
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
}
@@ -851,7 +887,6 @@ The feature flag context contains information about the flags evaluated prior to
851887

852888
- Example: `false`
853889

854-
855890
### Example Feature Flag Context
856891

857892
```json

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

+2-3
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)