perplex.js 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.js +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perplex.js",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Minimal Node.js client for the Perplexity API",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/client.js CHANGED
@@ -7,11 +7,21 @@ import {
7
7
 
8
8
  function defaultHeaders(cookie) {
9
9
  const headers = {
10
- 'accept': 'text/event-stream, text/plain, */*',
10
+ 'accept': 'text/event-stream',
11
+ 'accept-language': 'fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7',
11
12
  'content-type': 'application/json',
12
13
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
13
14
  'origin': 'https://www.perplexity.ai',
14
- 'referer': 'https://www.perplexity.ai/'
15
+ 'referer': 'https://www.perplexity.ai/',
16
+ 'priority': 'u=1, i',
17
+ 'sec-ch-ua': '"Chromium";v="142", "Google Chrome";v="142", "Not_A Brand";v="99"',
18
+ 'sec-ch-ua-mobile': '?0',
19
+ 'sec-ch-ua-platform': '"Windows"',
20
+ 'sec-fetch-dest': 'empty',
21
+ 'sec-fetch-mode': 'cors',
22
+ 'sec-fetch-site': 'same-origin',
23
+ 'x-perplexity-request-reason': 'perplexity-query-state-provider',
24
+ // x-request-id ?
15
25
  };
16
26
 
17
27
  if (cookie) headers['cookie'] = typeof cookie === 'string' ? cookie : Object.entries(cookie).map(([k, v]) => `${k}=${v}`).join('; ');