···11+# Notifications
22+33+Notifications show records that mention the authenticated user. When someone likes your post, follows you, or references your DID in any record, it appears in your notifications.
44+55+## How It Works
66+77+The `notifications` query searches all records for your DID. It returns matches where:
88+- The record's JSON contains your DID (as a URI or raw DID)
99+- The record was authored by someone else (self-mentions excluded)
1010+1111+The server identifies you from your access token. Authentication is required.
1212+1313+## Basic Query
1414+1515+```graphql
1616+query {
1717+ notifications(first: 20) {
1818+ edges {
1919+ node {
2020+ __typename
2121+ ... on AppBskyFeedLike {
2222+ uri
2323+ did
2424+ createdAt
2525+ }
2626+ ... on AppBskyGraphFollow {
2727+ uri
2828+ did
2929+ createdAt
3030+ }
3131+ }
3232+ cursor
3333+ }
3434+ pageInfo {
3535+ hasNextPage
3636+ endCursor
3737+ }
3838+ }
3939+}
4040+```
4141+4242+The `node` is a union type containing all record types in your schema. Use inline fragments (`... on TypeName`) to access type-specific fields.
4343+4444+## Response Example
4545+4646+When Alice likes your post and Bob follows you:
4747+4848+```json
4949+{
5050+ "data": {
5151+ "notifications": {
5252+ "edges": [
5353+ {
5454+ "node": {
5555+ "__typename": "AppBskyGraphFollow",
5656+ "uri": "at://did:plc:bob/app.bsky.graph.follow/3k2yab7",
5757+ "did": "did:plc:bob",
5858+ "createdAt": "2024-01-03T12:00:00Z"
5959+ },
6060+ "cursor": "eyJ..."
6161+ },
6262+ {
6363+ "node": {
6464+ "__typename": "AppBskyFeedLike",
6565+ "uri": "at://did:plc:alice/app.bsky.feed.like/3k2xz9m",
6666+ "did": "did:plc:alice",
6767+ "createdAt": "2024-01-02T10:30:00Z"
6868+ },
6969+ "cursor": "eyJ..."
7070+ }
7171+ ],
7272+ "pageInfo": {
7373+ "hasNextPage": false,
7474+ "endCursor": "eyJ..."
7575+ }
7676+ }
7777+ }
7878+}
7979+```
8080+8181+Results are sorted newest-first by rkey (TID).
8282+8383+## Filtering by Collection
8484+8585+Filter to specific record types using the `collections` argument:
8686+8787+```graphql
8888+query {
8989+ notifications(collections: [APP_BSKY_FEED_LIKE], first: 20) {
9090+ edges {
9191+ node {
9292+ ... on AppBskyFeedLike {
9393+ uri
9494+ did
9595+ }
9696+ }
9797+ }
9898+ }
9999+}
100100+```
101101+102102+Collection names use the enum format: `app.bsky.feed.like` becomes `APP_BSKY_FEED_LIKE`.
103103+104104+Filter to multiple types:
105105+106106+```graphql
107107+query {
108108+ notifications(
109109+ collections: [APP_BSKY_FEED_LIKE, APP_BSKY_GRAPH_FOLLOW]
110110+ first: 20
111111+ ) {
112112+ # ...
113113+ }
114114+}
115115+```
116116+117117+## Pagination
118118+119119+Use cursor-based pagination to fetch more results:
120120+121121+```graphql
122122+query {
123123+ notifications(first: 20, after: "eyJ...") {
124124+ edges {
125125+ node { __typename }
126126+ cursor
127127+ }
128128+ pageInfo {
129129+ hasNextPage
130130+ endCursor
131131+ }
132132+ }
133133+}
134134+```
135135+136136+Pass `pageInfo.endCursor` as the `after` argument to fetch the next page.
137137+138138+## Real-time Updates
139139+140140+Subscribe to new notifications as they happen:
141141+142142+```graphql
143143+subscription {
144144+ notificationCreated {
145145+ __typename
146146+ ... on AppBskyFeedLike {
147147+ uri
148148+ did
149149+ createdAt
150150+ }
151151+ ... on AppBskyGraphFollow {
152152+ uri
153153+ did
154154+ createdAt
155155+ }
156156+ }
157157+}
158158+```
159159+160160+Filter to specific collections:
161161+162162+```graphql
163163+subscription {
164164+ notificationCreated(collections: [APP_BSKY_FEED_LIKE]) {
165165+ ... on AppBskyFeedLike {
166166+ uri
167167+ did
168168+ }
169169+ }
170170+}
171171+```
172172+173173+See [Subscriptions](./subscriptions.md) for WebSocket connection details.
174174+175175+## Authentication Required
176176+177177+Notifications require authentication. Without a valid access token, the query returns an error.
178178+179179+Use the [Quickslice client SDK](./authentication.md#using-the-client-sdk) to handle authentication automatically.