Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

attribution.ts

18 lines653 Bytes

1export const PERPLEXITY_INTEGRATION_HEADER = 'X-Pplx-Integration'
2export const PERPLEXITY_INTEGRATION_HEADER_VALUE = `tanstack/${__PACKAGE_VERSION__}`
3​
4/**
5 * Attribution header Perplexity uses to identify TanStack AI traffic
6 * (`X-Pplx-Integration: tanstack/<package-version>`).
7 *
8 * The Search client sends this automatically. Pass it as
9 * `openaiCompatible({ defaultHeaders })` if you want the same header on
10 * Sonar chat requests.
11 */
12export function getPerplexityIntegrationHeaders(): Record<string, string> {
13 return {
14 [PERPLEXITY_INTEGRATION_HEADER]: PERPLEXITY_INTEGRATION_HEADER_VALUE,
15 }
17​
18declare const __PACKAGE_VERSION__: string