twitter-openapi-typescript
Advanced tools
Comparing version 0.0.39 to 0.0.40
{ | ||
"name": "twitter-openapi-typescript", | ||
"version": "0.0.39", | ||
"version": "0.0.40", | ||
"description": "Implementation of Twitter internal API in TypeScript", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -44,5 +44,6 @@ # twitter-openapi-typescript | ||
```typescript | ||
TwitterOpenApi.additionalApiHeaders = { | ||
const api = new TwitterOpenApi(); | ||
api.setAdditionalApiHeaders({ | ||
'sec-ch-ua-platform': '"Windows"', | ||
}; | ||
}); | ||
``` | ||
@@ -59,8 +60,11 @@ | ||
Most values exist as static variables. There is no need to change them. | ||
Changing them could result in account suspension. | ||
For advanced customization, use the | ||
You can also use the `TwitterOpenApiClient` class directly | ||
```typescript | ||
import { TwitterOpenApi } from 'twitter-openapi-typescript'; | ||
TwitterOpenApi.additionalBrowserHeaders = {}; | ||
TwitterOpenApi.additionalApiHeaders = {}; | ||
TwitterOpenApi.fetchApi = fetch.bind(globalThis); | ||
TwitterOpenApi.twitter = 'https://x.com/home'; | ||
TwitterOpenApi.bearer = 'xxxx'; | ||
``` | ||
@@ -67,0 +71,0 @@ |
@@ -30,6 +30,6 @@ import { TwitterOpenApi } from '@/api'; | ||
export const getClient = async () => { | ||
TwitterOpenApi.additionalApiHeaders = { | ||
const api = new TwitterOpenApi(); | ||
api.setAdditionalApiHeaders({ | ||
'sec-ch-ua-platform': '"Windows"', | ||
}; | ||
const api = new TwitterOpenApi(); | ||
}); | ||
const data = await fs.readFile('cookies.json', 'utf-8'); | ||
@@ -36,0 +36,0 @@ const parsed = JSON.parse(data); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
289222
76