add the chat proxy service constant

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-03 13:29:19 +03:00
parent 0d7dcfc5b0
commit dc9741d8ba
+16
View File
@@ -1,5 +1,6 @@
import {type Insets, Platform} from 'react-native'
import {type AppBskyActorDefs, BSKY_LABELER_DID} from '@atproto/api'
import {type Service} from '@atproto/lex'
import {type ProxyHeaderValue} from '#/state/session/agent'
import {BLUESKY_PROXY_DID, CHAT_PROXY_DID, IS_DEV} from '#/env'
@@ -247,6 +248,21 @@ export const BLUESKY_PROXY_HEADER = {
},
}
/**
* The chat service's proxy target, in the `did#service_id` form a lex client's
* `service` option takes. A client constructed with it emits `atproto-proxy:
* <this value>` on every request, which is what routes `chat.bsky.*` calls to
* the chat service.
*
* The DID comes from the env-configurable `CHAT_PROXY_DID` (via
* `EXPO_PUBLIC_CHAT_PROXY_DID`) rather than a hard-coded constant, so the
* target can be retargeted per environment.
*
* This is the client-level equivalent of {@link DM_SERVICE_HEADERS}, which
* carries the same value as a per-call header.
*/
export const CHAT_PROXY_SERVICE: Service = `${CHAT_PROXY_DID}#bsky_chat`
export const DM_SERVICE_HEADERS = {
'atproto-proxy': `${CHAT_PROXY_DID}#bsky_chat`,
}