eliza icon indicating copy to clipboard operation
eliza copied to clipboard

feat: Integrate Twitter V2 API

Open monilpat opened this issue 1 year ago • 2 comments


Relates to:

No specific issue or ticket linked. Sister PR (client side usage of): https://github.com/ai16z/agent-twitter-client/pull/3/files


Risks

Risk Level: Medium

  • Potential Impacts:
    • Breaks compatibility with existing Twitter V1 API usage if misconfigured.
    • Errors in authentication if API keys or tokens are invalid or not provided.

Background

What does this PR do?

This PR integrates support for the Twitter V2 API in the application while maintaining fallback compatibility with the V1 API for scenarios where V2 credentials are unavailable. Key features include:

  • Authentication using V2 API keys and tokens.
  • Enhanced tweet handling logic to differentiate between V1 and V2.
  • Updated .env.example file to include required settings for V2 API.

What kind of change is this?

  • Feature: Adds functionality for Twitter V2 API integration.

Why are we doing this?

The integration of the Twitter V2 API ensures better performance, additional functionality, and alignment with the latest Twitter developer standards. Maintaining V1 as a fallback ensures backward compatibility.


Documentation changes needed?

  • [x] My changes require a change to the project documentation.
  • [ ] If a docs change is needed: I have updated the documentation accordingly.

Changes to .env.example and setup instructions for V2 API keys must be added to the documentation.


Testing

Where should a reviewer start?

  1. Review changes in packages/client-twitter/src/* for updated API integration logic.
  2. Validate .env.example updates for configuration changes.

Detailed testing steps

  1. Configure .env with V2 API keys and tokens.
  2. Run the application to verify successful authentication via V2.
  3. Remove V2 credentials and test fallback to V1.
  4. Perform end-to-end tweet retrieval and posting for both V1 and V2 modes.

Screenshots

Before

N/A (No V2 integration)

After

N/A (No UI changes)


Deploy Notes

  1. Ensure .env includes both V1 and V2 API credentials.
  2. Update deployment scripts to validate environment variables for the V2 API.

Database changes

None.


Deployment instructions

Standard deployment process; no additional steps required.


Discord username

@0x8664 for project communication and role assignment.

monilpat avatar Nov 21 '24 06:11 monilpat

+2

aj47 avatar Dec 05 '24 07:12 aj47

This pull request has been automatically marked as stale due to 30 days of inactivity. If no further activity occurs within 7 days, it will be closed automatically. Please take action if this pull request is still relevant.

github-actions[bot] avatar Jan 04 '25 18:01 github-actions[bot]