The Upstreet Agents SDK is now in public beta 🎉 Get started →
API ReferenceIntegrations

Integrations

Integrating with other libraries

Discord

Add Discord integration to your agent by following these steps:

  1. Create a Discord bot application:

  2. Configure bot settings:

  3. Add the bot to your server:

    • Visit this URL (replace CLIENT_ID with your actual ID):
      https://discord.com/oauth2/authorize/?permissions=-2080908480&scope=bot&client_id=CLIENT_ID
    • Select the server you want to add the bot to
    • Authorize the bot
  4. Get your bot token:

  5. Configure your agent:

    • Add the following component to your agent:
    import { Discord } from 'react-agents';
     
    return (
     <Agent>
       {/* ... */}
       <Discord
         token="YOUR_BOT_TOKEN" // The bot token from step 4
         channels={[
           "general", // Text channel names the bot should listen to
           "voice-chat" // Voice channel names the bot should listen to
         ]}
         dms={true} // Enable direct messages with the bot
         userWhitelist={[ // Optional: restrict which users can interact
           "user1#1234",
           "user2#5678"
         ]}
       />
       {/* ... */}
     </Agent>
    );

    Additional Notes:

    • The bot will only respond in the specified channels and to whitelisted users (if configured)
    • Voice channel support requires additional Discord permissions (see above)
    • Channel names are case-sensitive and should match exactly
    • For DMs, users must share a server with the bot
    • The bot token should be kept secure and not committed to version control.
      • You can use .env.txt and the useEnv() hook to load it at runtime.
    • If you need to reset the token for security reasons, you can do so in the Discord Developer Portal
    • The bot requires a stable internet connection to maintain WebSocket connection with Discord
    • Rate limits apply to bot actions - see Discord's developer documentation for details

Twitter

Twitter integration allows your agent to interact with Twitter by responding to mentions.

  1. Create a Twitter Developer Account:

    • Go to https://developer.twitter.com/
    • Sign up for a developer account if you haven't already
    • Create a new project and app
    • Make sure your "User authentication settings" are set to "Native app" (Public client)
    • Copy your OAuth 2.0 application credentials (Client ID and Client Secret)
  2. Log in with oauth at https://twitter-auth.upstreet.ai/

    • Use the Client ID and Client Secret from step 1
  3. Configure your agent:

    • Add the following component to your agent:
    import { Twitter } from 'react-agents';
     
    return (
      <Agent>
        {/* ... */}
        <Twitter
          token="YOUR_TWITTER_TOKEN" // OAuth 2.0 token
        />
        {/* ... */}
      </Agent>
    );

    Additional Notes:

    • The bot will automatically listen for and respond to mentions of your Twitter account
    • The token should be kept secure and not committed to version control
      • You can use .env.txt and the useEnv() hook to load it at runtime
    • The bot polls for new mentions every 10 seconds
    • Twitter API rate limits apply - see Twitter's developer documentation for details
    • The bot requires a stable internet connection to maintain communication with Twitter
    • Note: if you haven't created the agent yet, please follow this Create an Agent first.