add the chat proxy service constant
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import {type Insets, Platform} from 'react-native'
|
import {type Insets, Platform} from 'react-native'
|
||||||
import {type AppBskyActorDefs, BSKY_LABELER_DID} from '@atproto/api'
|
import {type AppBskyActorDefs, BSKY_LABELER_DID} from '@atproto/api'
|
||||||
|
import {type Service} from '@atproto/lex'
|
||||||
|
|
||||||
import {type ProxyHeaderValue} from '#/state/session/agent'
|
import {type ProxyHeaderValue} from '#/state/session/agent'
|
||||||
import {BLUESKY_PROXY_DID, CHAT_PROXY_DID, IS_DEV} from '#/env'
|
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 = {
|
export const DM_SERVICE_HEADERS = {
|
||||||
'atproto-proxy': `${CHAT_PROXY_DID}#bsky_chat`,
|
'atproto-proxy': `${CHAT_PROXY_DID}#bsky_chat`,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user