Skip to content

Add X-Pplx-Integration header to Perplexity sample client - #343

Open
Saleh Alghusson (qirh) wants to merge 6 commits into
microsoft:mainfrom
qirh:feat/perplexity-integration-header
Open

Saleh Alghusson (qirh) wants to merge 6 commits into
microsoft:mainfrom
qirh:feat/perplexity-integration-header

Conversation

@qirh

Copy link
Copy Markdown

Adds an X-Pplx-Integration: agent365-samples default header to the Node.js Perplexity sample's SDK client so Perplexity can recognize API traffic coming from this sample.

  • The header is only attached when the client's resolved base URL host is exactly api.perplexity.ai. If PERPLEXITY_BASE_URL points to a proxy or other host, the client is unchanged.
  • No change to authentication, model selection, or request payloads.

Verification:

  • npm install and npx tsc -p . in nodejs/perplexity/sample-agent succeed.
  • Local harness with a stubbed fetch against the built client: header sent once for the default and explicit https://api.perplexity.ai base URLs; not sent for a custom proxy host or a lookalike host (api.perplexity.ai.evil.com); Authorization unchanged in all cases (12/12 checks).
  • Prettier reports no issues on the added lines.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@qirh
Saleh Alghusson (qirh) requested a review from a team as a code owner October 12, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants