Introduction
This guide covers creating and deploying X (Twitter) bots on Shard Cloud.Creating an X App
1
Access Developer Portal
Go to X Developer Portal and
log in.
2
Create Project
Click “Create Project”, choose a name, and select your use case.
3
Create App
Create an app within your project.
4
Generate API Keys
In “Keys and tokens”, generate: - API Key (Consumer Key) - API Secret
Key (Consumer Secret) - Access Token - Access Token Secret
5
Set Permissions
Go to “App permissions” and select “Read and write”.
Creating Your Bot
Setup
Basic Bot Code
index.js
Package.json
package.json
Environment Variables
Set these in the Shard Cloud dashboard:API_KEY: Your X API keyAPI_SECRET_KEY: Your X API secretACCESS_TOKEN: Your access tokenACCESS_TOKEN_SECRET: Your access token secret
Shard Cloud Configuration
.shardcloud
Deploying
1
Prepare Your Files
Ensure you have: -
index.js - package.json - .shardcloud2
Set Environment Variables
Configure all API credentials in the dashboard.
3
Create ZIP Archive
Compress your project folder (excluding
node_modules/).4
Upload to Shard Cloud
Go to Shard Cloud Dashboard and
upload.
Additional Resources
Troubleshooting
Authentication errors
Authentication errors
- Verify all four credentials are correct - Check that permissions are set to “Read and write” - Regenerate tokens if needed
Rate limit exceeded
Rate limit exceeded
Implement rate limiting and reduce request frequency.