@elizaos/plugin-twitter 1.0.9 โ 1.0.14
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.
- package/README.md +345 -111
- package/dist/index.d.ts +186 -1076
- package/dist/index.js +2079 -8017
- package/dist/index.js.map +1 -1
- package/package.json +118 -138
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/node-L7ZVN5QV.js +0 -40
- package/dist/node-L7ZVN5QV.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,159 +1,393 @@
|
|
|
1
1
|
# Eliza Twitter/X Client
|
|
2
2
|
|
|
3
|
-
This package provides Twitter/X integration for the Eliza AI agent.
|
|
3
|
+
This package provides Twitter/X integration for the Eliza AI agent using the official Twitter API v2.
|
|
4
|
+
|
|
5
|
+
## ๐จ TL;DR - Quick Setup
|
|
6
|
+
|
|
7
|
+
**Just want your bot to post tweets? Here's the fastest path:**
|
|
8
|
+
|
|
9
|
+
1. **Get Twitter Developer account** โ https://developer.twitter.com
|
|
10
|
+
2. **Create an app** โ Enable "Read and write" permissions
|
|
11
|
+
3. **Get OAuth 1.0a credentials** (NOT OAuth 2.0!):
|
|
12
|
+
- API Key & Secret (from "Consumer Keys")
|
|
13
|
+
- Access Token & Secret (from "Authentication Tokens")
|
|
14
|
+
4. **Add to `.env`:**
|
|
15
|
+
```bash
|
|
16
|
+
TWITTER_API_KEY=xxx
|
|
17
|
+
TWITTER_API_SECRET_KEY=xxx
|
|
18
|
+
TWITTER_ACCESS_TOKEN=xxx
|
|
19
|
+
TWITTER_ACCESS_TOKEN_SECRET=xxx
|
|
20
|
+
TWITTER_POST_ENABLE=true
|
|
21
|
+
TWITTER_POST_IMMEDIATELY=true
|
|
22
|
+
```
|
|
23
|
+
5. **Run:** `bun start`
|
|
24
|
+
|
|
25
|
+
โ ๏ธ **Common mistake:** Using OAuth 2.0 credentials instead of OAuth 1.0a - see [Step 3](#step-3-get-the-right-credentials-oauth-10a) for details!
|
|
4
26
|
|
|
5
27
|
## Features
|
|
6
28
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
29
|
+
- โ
**Autonomous tweet posting** with configurable intervals
|
|
30
|
+
- โ
**Timeline monitoring** and interaction
|
|
31
|
+
- โ
**Mention and reply handling**
|
|
32
|
+
- โ
**Search functionality**
|
|
33
|
+
- โ
**Direct message support**
|
|
34
|
+
- โ
**Advanced timeline algorithms** with weighted scoring
|
|
35
|
+
- โ
**Comprehensive caching system**
|
|
36
|
+
- โ
**Built-in rate limiting and retry mechanisms**
|
|
13
37
|
|
|
14
|
-
##
|
|
38
|
+
## Prerequisites
|
|
15
39
|
|
|
16
|
-
|
|
40
|
+
- Twitter Developer Account with API v2 access
|
|
41
|
+
- Twitter OAuth 1.0a credentials (NOT OAuth 2.0)
|
|
42
|
+
- Node.js and bun installed
|
|
17
43
|
|
|
18
|
-
|
|
19
|
-
- Node.js and pnpm installed
|
|
20
|
-
- Discord bot (if using approval workflow)
|
|
21
|
-
- ElevenLabs API key (if using Spaces with TTS)
|
|
44
|
+
## ๐ Quick Start
|
|
22
45
|
|
|
23
|
-
### Step 1:
|
|
46
|
+
### Step 1: Get Twitter Developer Access
|
|
47
|
+
|
|
48
|
+
1. Apply for a developer account at https://developer.twitter.com
|
|
49
|
+
2. Create a new app in the [Developer Portal](https://developer.twitter.com/en/portal/projects-and-apps)
|
|
50
|
+
3. Ensure your app has API v2 access
|
|
51
|
+
|
|
52
|
+
### Step 2: Configure App Permissions for Posting
|
|
53
|
+
|
|
54
|
+
**โ ๏ธ CRITICAL: Default apps can only READ. You must enable WRITE permissions to post tweets!**
|
|
55
|
+
|
|
56
|
+
1. In your app settings, go to **"User authentication settings"**
|
|
57
|
+
2. Configure exactly as shown:
|
|
58
|
+
|
|
59
|
+
**App permissions**: `Read and write` โ
|
|
60
|
+
|
|
61
|
+
**Type of App**: `Web App, Automated App or Bot`
|
|
62
|
+
|
|
63
|
+
**Required URLs** (copy these exactly):
|
|
64
|
+
```
|
|
65
|
+
Callback URI: http://localhost:3000/callback
|
|
66
|
+
Website URL: https://github.com/elizaos/eliza
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Optional fields**:
|
|
70
|
+
```
|
|
71
|
+
Organization name: ElizaOS
|
|
72
|
+
Organization URL: https://github.com/elizaos/eliza
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. Click **Save**
|
|
76
|
+
|
|
77
|
+
### Step 3: Get the RIGHT Credentials (OAuth 1.0a)
|
|
78
|
+
|
|
79
|
+
**โ ๏ธ IMPORTANT: You need OAuth 1.0a credentials, NOT OAuth 2.0!**
|
|
80
|
+
|
|
81
|
+
In your app's **"Keys and tokens"** page, you'll see several sections. Here's what to use:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
โ
USE THESE (OAuth 1.0a):
|
|
85
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
86
|
+
โ Consumer Keys โ
|
|
87
|
+
โ โโ API Key: xxx...xxx โ TWITTER_API_KEY โ
|
|
88
|
+
โ โโ API Key Secret: xxx...xxx โ TWITTER_API_SECRET_KEY โ
|
|
89
|
+
โ โ
|
|
90
|
+
โ Authentication Tokens โ
|
|
91
|
+
โ โโ Access Token: xxx...xxx โ TWITTER_ACCESS_TOKEN โ
|
|
92
|
+
โ โโ Access Token Secret: xxx โ TWITTER_ACCESS_TOKEN_SECRET โ
|
|
93
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
94
|
+
|
|
95
|
+
โ DO NOT USE THESE (OAuth 2.0):
|
|
96
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
97
|
+
โ OAuth 2.0 Client ID and Client Secret โ
|
|
98
|
+
โ โโ Client ID: xxx...xxx โ IGNORE โ
|
|
99
|
+
โ โโ Client Secret: xxx...xxx โ IGNORE โ
|
|
100
|
+
โ โ
|
|
101
|
+
โ Bearer Token โ IGNORE โ
|
|
102
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**After enabling write permissions, you MUST:**
|
|
106
|
+
1. Click **"Regenerate"** on Access Token & Secret
|
|
107
|
+
2. Copy the NEW tokens (old ones won't have write access)
|
|
108
|
+
3. Look for "Created with Read and Write permissions" โ
|
|
109
|
+
|
|
110
|
+
### Step 4: Configure Environment Variables
|
|
24
111
|
|
|
25
112
|
Create or edit `.env` file in your project root:
|
|
26
113
|
|
|
27
114
|
```bash
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
115
|
+
# REQUIRED: OAuth 1.0a Credentials (from "Consumer Keys" section)
|
|
116
|
+
TWITTER_API_KEY=your_api_key_here # From "API Key"
|
|
117
|
+
TWITTER_API_SECRET_KEY=your_api_key_secret_here # From "API Key Secret"
|
|
118
|
+
|
|
119
|
+
# REQUIRED: OAuth 1.0a Tokens (from "Authentication Tokens" section)
|
|
120
|
+
TWITTER_ACCESS_TOKEN=your_access_token_here # Must have "Read and Write"
|
|
121
|
+
TWITTER_ACCESS_TOKEN_SECRET=your_token_secret_here # Regenerate after permission change
|
|
122
|
+
|
|
123
|
+
# Basic Configuration
|
|
124
|
+
TWITTER_DRY_RUN=false # Set to true to test without posting
|
|
125
|
+
TWITTER_POST_ENABLE=true # Set to true to enable auto-posting
|
|
126
|
+
|
|
127
|
+
# Optional: Posting Configuration
|
|
128
|
+
TWITTER_POST_IMMEDIATELY=true # Post on startup (great for testing)
|
|
129
|
+
TWITTER_POST_INTERVAL_MIN=90 # Minimum minutes between posts
|
|
130
|
+
TWITTER_POST_INTERVAL_MAX=180 # Maximum minutes between posts
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Step 5: Run Your Bot
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
// Your character should include the twitter plugin
|
|
137
|
+
const character = {
|
|
138
|
+
// ... other config
|
|
139
|
+
plugins: [
|
|
140
|
+
"@elizaos/plugin-bootstrap", // Required for content generation
|
|
141
|
+
"@elizaos/plugin-twitter" // Twitter functionality
|
|
142
|
+
],
|
|
143
|
+
postExamples: [ // Examples for tweet generation
|
|
144
|
+
"Just discovered an amazing pattern in the data...",
|
|
145
|
+
"The future of AI is collaborative intelligence",
|
|
146
|
+
// ... more examples
|
|
147
|
+
]
|
|
148
|
+
};
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Then start your bot:
|
|
152
|
+
```bash
|
|
153
|
+
bun run start
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## ๐ Complete Configuration Reference
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Required Twitter API v2 Credentials (OAuth 1.0a)
|
|
160
|
+
TWITTER_API_KEY= # Consumer API Key
|
|
161
|
+
TWITTER_API_SECRET_KEY= # Consumer API Secret
|
|
162
|
+
TWITTER_ACCESS_TOKEN= # Access Token (with write permissions)
|
|
163
|
+
TWITTER_ACCESS_TOKEN_SECRET= # Access Token Secret
|
|
164
|
+
|
|
165
|
+
# Basic Configuration
|
|
166
|
+
TWITTER_DRY_RUN=false # Set to true for testing without posting
|
|
167
|
+
TWITTER_TARGET_USERS= # Comma-separated usernames to target (use "*" for all)
|
|
168
|
+
TWITTER_RETRY_LIMIT=5 # Maximum retry attempts for failed operations
|
|
169
|
+
TWITTER_POLL_INTERVAL=120 # Timeline polling interval (seconds)
|
|
41
170
|
|
|
42
171
|
# Post Generation Settings
|
|
43
|
-
|
|
172
|
+
TWITTER_POST_ENABLE=false # Enable autonomous tweet posting
|
|
44
173
|
TWITTER_POST_INTERVAL_MIN=90 # Minimum interval between posts (minutes)
|
|
45
|
-
|
|
46
|
-
TWITTER_POST_IMMEDIATELY=false #
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
174
|
+
TWITTER_POST_INTERVAL_MAX=180 # Maximum interval between posts (minutes)
|
|
175
|
+
TWITTER_POST_IMMEDIATELY=false # Post immediately on startup
|
|
176
|
+
TWITTER_POST_INTERVAL_VARIANCE=0.2 # Random variance factor for posting intervals
|
|
177
|
+
|
|
178
|
+
# Interaction Settings
|
|
179
|
+
TWITTER_SEARCH_ENABLE=true # Enable timeline monitoring and interactions
|
|
180
|
+
TWITTER_INTERACTION_INTERVAL_MIN=15 # Minimum interval between interactions (minutes)
|
|
181
|
+
TWITTER_INTERACTION_INTERVAL_MAX=30 # Maximum interval between interactions (minutes)
|
|
182
|
+
TWITTER_INTERACTION_INTERVAL_VARIANCE=0.3 # Random variance for interaction intervals
|
|
183
|
+
TWITTER_AUTO_RESPOND_MENTIONS=true # Automatically respond to mentions
|
|
184
|
+
TWITTER_AUTO_RESPOND_REPLIES=true # Automatically respond to replies
|
|
185
|
+
TWITTER_MAX_INTERACTIONS_PER_RUN=10 # Maximum interactions processed per cycle
|
|
186
|
+
|
|
187
|
+
# Timeline Algorithm Configuration
|
|
188
|
+
TWITTER_TIMELINE_ALGORITHM=weighted # Algorithm: "weighted" or "latest"
|
|
189
|
+
TWITTER_TIMELINE_USER_BASED_WEIGHT=3 # Weight for user-based scoring
|
|
190
|
+
TWITTER_TIMELINE_TIME_BASED_WEIGHT=2 # Weight for time-based scoring
|
|
191
|
+
TWITTER_TIMELINE_RELEVANCE_WEIGHT=5 # Weight for relevance scoring
|
|
192
|
+
|
|
193
|
+
# Advanced Settings
|
|
194
|
+
TWITTER_MAX_TWEET_LENGTH=4000 # Maximum tweet length (for threads)
|
|
195
|
+
TWITTER_DM_ONLY=false # Only interact via direct messages
|
|
196
|
+
TWITTER_ENABLE_ACTION_PROCESSING=false # Enable timeline action processing
|
|
197
|
+
TWITTER_ACTION_INTERVAL=240 # Action processing interval (minutes)
|
|
61
198
|
```
|
|
62
199
|
|
|
63
|
-
|
|
200
|
+
## ๐ฏ Common Use Cases
|
|
64
201
|
|
|
65
|
-
|
|
66
|
-
import { TwitterClientInterface } from "@elizaos/twitter";
|
|
202
|
+
### Just Want to Post Tweets?
|
|
67
203
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
204
|
+
```bash
|
|
205
|
+
# Minimal setup for posting only
|
|
206
|
+
TWITTER_API_KEY=xxx
|
|
207
|
+
TWITTER_API_SECRET_KEY=xxx
|
|
208
|
+
TWITTER_ACCESS_TOKEN=xxx # Must have write permissions!
|
|
209
|
+
TWITTER_ACCESS_TOKEN_SECRET=xxx
|
|
210
|
+
|
|
211
|
+
TWITTER_POST_ENABLE=true
|
|
212
|
+
TWITTER_POST_IMMEDIATELY=true # Great for testing
|
|
213
|
+
TWITTER_SEARCH_ENABLE=false # Disable interactions
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Want Full Interaction Bot?
|
|
73
217
|
|
|
74
|
-
|
|
75
|
-
|
|
218
|
+
```bash
|
|
219
|
+
# Full interaction setup
|
|
220
|
+
TWITTER_API_KEY=xxx
|
|
221
|
+
TWITTER_API_SECRET_KEY=xxx
|
|
222
|
+
TWITTER_ACCESS_TOKEN=xxx
|
|
223
|
+
TWITTER_ACCESS_TOKEN_SECRET=xxx
|
|
224
|
+
|
|
225
|
+
TWITTER_POST_ENABLE=true
|
|
226
|
+
TWITTER_SEARCH_ENABLE=true
|
|
227
|
+
TWITTER_AUTO_RESPOND_MENTIONS=true
|
|
228
|
+
TWITTER_AUTO_RESPOND_REPLIES=true
|
|
76
229
|
```
|
|
77
230
|
|
|
78
|
-
|
|
231
|
+
### Testing Without Posting?
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Dry run mode
|
|
235
|
+
TWITTER_DRY_RUN=true # Simulates all actions
|
|
236
|
+
TWITTER_POST_ENABLE=true
|
|
237
|
+
TWITTER_POST_IMMEDIATELY=true
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## ๐ง Troubleshooting
|
|
241
|
+
|
|
242
|
+
### "403 Forbidden" When Posting
|
|
243
|
+
|
|
244
|
+
This is the #1 issue! Your app has read-only permissions.
|
|
79
245
|
|
|
80
|
-
|
|
246
|
+
**Solution:**
|
|
247
|
+
1. Go to app settings โ "User authentication settings"
|
|
248
|
+
2. Change to "Read and write"
|
|
249
|
+
3. Save settings
|
|
250
|
+
4. **CRITICAL**: Regenerate your Access Token & Secret
|
|
251
|
+
5. Update `.env` with NEW tokens
|
|
252
|
+
6. Restart your bot
|
|
81
253
|
|
|
82
|
-
|
|
83
|
-
- Regular tweets (โค280 characters)
|
|
84
|
-
- Long-form tweets (Note Tweets)
|
|
85
|
-
- Media tweets (with images/videos)
|
|
254
|
+
**How to verify:** In "Keys and tokens", your Access Token should show "Created with Read and Write permissions"
|
|
86
255
|
|
|
87
|
-
###
|
|
256
|
+
### "Could not authenticate you"
|
|
88
257
|
|
|
89
|
-
|
|
90
|
-
- Mentions
|
|
91
|
-
- Replies
|
|
92
|
-
- Quote tweets
|
|
93
|
-
- Direct messages
|
|
258
|
+
Wrong credentials or using OAuth 2.0 instead of OAuth 1.0a.
|
|
94
259
|
|
|
95
|
-
|
|
260
|
+
**Solution:**
|
|
261
|
+
- Use credentials from "Consumer Keys" section (API Key/Secret)
|
|
262
|
+
- Use credentials from "Authentication Tokens" section (Access Token/Secret)
|
|
263
|
+
- Do NOT use OAuth 2.0 Client ID, Client Secret, or Bearer Token
|
|
96
264
|
|
|
97
|
-
|
|
265
|
+
### Bot Not Posting Automatically
|
|
98
266
|
|
|
99
|
-
|
|
267
|
+
**Checklist:**
|
|
268
|
+
- โ
Is `TWITTER_POST_ENABLE=true`?
|
|
269
|
+
- โ
Is `@elizaos/plugin-bootstrap` installed?
|
|
270
|
+
- โ
Does your character have `postExamples`?
|
|
271
|
+
- โ
Check logs for "Twitter posting is ENABLED"
|
|
272
|
+
- โ
Try `TWITTER_POST_IMMEDIATELY=true` for testing
|
|
100
273
|
|
|
101
|
-
|
|
102
|
-
- Speech-to-Text (STT) for transcription
|
|
103
|
-
- Text-to-Speech (TTS) via ElevenLabs
|
|
104
|
-
- Speaker management
|
|
105
|
-
- Idle monitoring
|
|
106
|
-
- Recording capabilities
|
|
274
|
+
### Timeline Not Loading
|
|
107
275
|
|
|
108
|
-
|
|
276
|
+
**Common causes:**
|
|
277
|
+
- Rate limiting (check Twitter Developer Portal)
|
|
278
|
+
- Invalid credentials
|
|
279
|
+
- Account restrictions
|
|
109
280
|
|
|
110
|
-
|
|
111
|
-
1. Generated tweets are sent to a Discord channel
|
|
112
|
-
2. Moderators can approve/reject via reactions
|
|
113
|
-
3. Approved tweets are automatically posted
|
|
281
|
+
### "Invalid or expired token"
|
|
114
282
|
|
|
115
|
-
|
|
283
|
+
Your tokens may have been revoked or regenerated.
|
|
116
284
|
|
|
117
|
-
|
|
285
|
+
**Solution:**
|
|
286
|
+
1. Go to Twitter Developer Portal
|
|
287
|
+
2. Regenerate all tokens
|
|
288
|
+
3. Update `.env`
|
|
289
|
+
4. Restart bot
|
|
290
|
+
|
|
291
|
+
## ๐ Advanced Features
|
|
292
|
+
|
|
293
|
+
### Timeline Algorithms
|
|
294
|
+
|
|
295
|
+
**Weighted Algorithm** (default):
|
|
296
|
+
- Combines user relationship, time, and relevance scores
|
|
297
|
+
- Prioritizes tweets from important users
|
|
298
|
+
- Balances recent content with relevant older content
|
|
299
|
+
|
|
300
|
+
**Latest Algorithm**:
|
|
301
|
+
- Processes tweets in chronological order
|
|
302
|
+
- Simpler, more predictable behavior
|
|
303
|
+
- Good for high-volume timelines
|
|
304
|
+
|
|
305
|
+
### Target User Configuration
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Interact with everyone (default)
|
|
309
|
+
TWITTER_TARGET_USERS=
|
|
310
|
+
|
|
311
|
+
# Interact with specific users only
|
|
312
|
+
TWITTER_TARGET_USERS=user1,user2,user3
|
|
313
|
+
|
|
314
|
+
# Interact with everyone (explicit)
|
|
315
|
+
TWITTER_TARGET_USERS=*
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Natural Posting Intervals
|
|
319
|
+
|
|
320
|
+
All intervals support variance for more human-like behavior:
|
|
321
|
+
```bash
|
|
322
|
+
# Base interval: 90-180 minutes
|
|
323
|
+
TWITTER_POST_INTERVAL_MIN=90
|
|
324
|
+
TWITTER_POST_INTERVAL_MAX=180
|
|
325
|
+
# With 20% variance: actual range ~72-216 minutes
|
|
326
|
+
TWITTER_POST_INTERVAL_VARIANCE=0.2
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Request Queue & Rate Limiting
|
|
330
|
+
|
|
331
|
+
The plugin includes sophisticated rate limiting:
|
|
332
|
+
- Automatic retry with exponential backoff
|
|
333
|
+
- Request queue to prevent API abuse
|
|
334
|
+
- Configurable retry limits
|
|
335
|
+
- Built-in caching to reduce API calls
|
|
336
|
+
|
|
337
|
+
## ๐งช Development & Testing
|
|
118
338
|
|
|
119
339
|
```bash
|
|
120
340
|
# Run tests
|
|
121
|
-
|
|
341
|
+
bun test
|
|
342
|
+
|
|
343
|
+
# Run with debug logging
|
|
344
|
+
DEBUG=eliza:* bun start
|
|
122
345
|
|
|
123
|
-
#
|
|
124
|
-
|
|
346
|
+
# Test without posting
|
|
347
|
+
TWITTER_DRY_RUN=true bun start
|
|
125
348
|
```
|
|
126
349
|
|
|
127
|
-
###
|
|
350
|
+
### Testing Checklist
|
|
351
|
+
|
|
352
|
+
1. **Test Auth**: Check logs for successful Twitter login
|
|
353
|
+
2. **Test Posting**: Set `TWITTER_POST_IMMEDIATELY=true`
|
|
354
|
+
3. **Test Dry Run**: Use `TWITTER_DRY_RUN=true` first
|
|
355
|
+
4. **Monitor Logs**: Look for "Twitter posting is ENABLED"
|
|
356
|
+
|
|
357
|
+
## ๐ Security Best Practices
|
|
358
|
+
|
|
359
|
+
- Store credentials in `.env` file (never commit!)
|
|
360
|
+
- Use `.env.local` for local development
|
|
361
|
+
- Regularly rotate API keys
|
|
362
|
+
- Monitor API usage in Developer Portal
|
|
363
|
+
- Enable only necessary permissions
|
|
364
|
+
- Review [Twitter's automation rules](https://help.twitter.com/en/rules-and-policies/twitter-automation)
|
|
365
|
+
|
|
366
|
+
## ๐ API Usage & Limits
|
|
367
|
+
|
|
368
|
+
This plugin uses Twitter API v2 endpoints efficiently:
|
|
369
|
+
- **Home Timeline**: Cached and refreshed periodically
|
|
370
|
+
- **Tweet Creation**: Rate limited automatically
|
|
371
|
+
- **User Lookups**: Cached to reduce calls
|
|
372
|
+
- **Search**: Configurable intervals
|
|
128
373
|
|
|
129
|
-
|
|
130
|
-
- Verify credentials in .env
|
|
131
|
-
- Check 2FA configuration
|
|
132
|
-
- Ensure no rate limiting
|
|
374
|
+
Monitor your usage at: https://developer.twitter.com/en/portal/dashboard
|
|
133
375
|
|
|
134
|
-
|
|
135
|
-
- Verify character profile configuration
|
|
136
|
-
- Check MAX_TWEET_LENGTH setting
|
|
137
|
-
- Monitor approval workflow logs
|
|
376
|
+
## ๐ Additional Resources
|
|
138
377
|
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
378
|
+
- [Twitter API v2 Documentation](https://developer.twitter.com/en/docs/twitter-api)
|
|
379
|
+
- [Twitter OAuth 1.0a Guide](https://developer.twitter.com/en/docs/authentication/oauth-1-0a)
|
|
380
|
+
- [Rate Limits Reference](https://developer.twitter.com/en/docs/twitter-api/rate-limits)
|
|
381
|
+
- [ElizaOS Documentation](https://github.com/elizaos/eliza)
|
|
143
382
|
|
|
144
|
-
##
|
|
383
|
+
## ๐ค Contributing
|
|
145
384
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
385
|
+
Contributions are welcome! Please:
|
|
386
|
+
1. Check existing issues first
|
|
387
|
+
2. Follow the code style
|
|
388
|
+
3. Add tests for new features
|
|
389
|
+
4. Update documentation
|
|
150
390
|
|
|
151
|
-
##
|
|
391
|
+
## ๐ License
|
|
152
392
|
|
|
153
|
-
|
|
154
|
-
1. Check the Common Issues section
|
|
155
|
-
2. Review debug logs (enable with DEBUG=eliza:*)
|
|
156
|
-
3. Open an issue with:
|
|
157
|
-
- Error messages
|
|
158
|
-
- Configuration details
|
|
159
|
-
- Steps to reproduce
|
|
393
|
+
This plugin is part of the ElizaOS project. See the main repository for license information.
|