kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
41 wiersze
907 B
Plaintext
41 wiersze
907 B
Plaintext
![]() |
---
|
||
|
title: Twitter
|
||
|
description: Official Twitter / X API client.
|
||
|
---
|
||
|
|
||
|
Basic Twitter API methods for fetching users, tweets, and searching recent tweets. Includes support for plan-aware rate-limiting. Uses [Nango](https://www.nango.dev) for OAuth support.
|
||
|
|
||
|
- package: `@agentic/twitter`
|
||
|
- exports: `class TwitterClient`, `namespace twitter`
|
||
|
- env vars: `TWITTER_API_KEY`, `TWITTER_API_PLAN`
|
||
|
- [source](https://github.com/transitive-bullshit/agentic/blob/main/packages/twitter/src/twitter-client.ts)
|
||
|
- [api docs](https://developer.twitter.com/en/docs/twitter-api)
|
||
|
|
||
|
## Install
|
||
|
|
||
|
<CodeGroup>
|
||
|
```bash npm
|
||
|
npm install @agentic/twitter
|
||
|
```
|
||
|
|
||
|
```bash yarn
|
||
|
yarn add @agentic/twitter
|
||
|
```
|
||
|
|
||
|
```bash pnpm
|
||
|
pnpm add @agentic/twitter
|
||
|
```
|
||
|
|
||
|
</CodeGroup>
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```ts
|
||
|
import { TwitterClient } from '@agentic/twitter'
|
||
|
|
||
|
const twitter = new TwitterClient()
|
||
|
const res = await twitter.createTweet({
|
||
|
text: 'hello, world'
|
||
|
})
|
||
|
```
|