Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twitter-openapi-typescript

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitter-openapi-typescript - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json
{
"name": "twitter-openapi-typescript",
"version": "0.0.4",
"version": "0.0.5",
"description": "Implementation of Twitter internal API in TypeScript",

@@ -5,0 +5,0 @@ "scripts": {

@@ -1,11 +0,17 @@

# twitter-openapi-typescript@0.0.2
# twitter-openapi-typescript@0.0.5
```sh
npm i twitter-openapi-typescript
```
```typescript
import { TwitterOpenApi } from "twitter-openapi-typescript";
import fetch from "node-fetch";
const api = new TwitterOpenApi();
const client = await api.getClientFromCookies('<csrf toke here>', '<auth token here>');
api.setFetchApi(fetch as any);
const client = await api.getClientFromCookies('<csrf toke here>', '<auth token here>'); // option
const response = await client.getUserApi().getUserByScreenName({ screenName: 'elonmusk' });
const legacy = response.data.legacy;
console.log(response.data);
console.log(legacy.screenName);
console.log(`followedBy: ${legacy.followedBy} following: ${legacy.following}`);
console.log(response.data.legacy.screenName);
console.log(`followCount: ${response.data.legacy.friendsCount} followersCount: ${response.data.legacy.followersCount}`);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc