Twitter OAuth setup for Authverse projects
This page details how to add and configure Twitter OAuth for Authverse projects.
Execute the following command to add the Twitter provider to your project:
npx authverse@latest oauth twitterNavigate to the Twitter Developer Portal (Projects & Apps → [Your App] → User authentication settings) and configure the App info:
http://localhost:3000/api/auth/callback/twitterhttps://example.com/api/auth/callback/twitterAdd the following variables to your project's .env file:
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=Replace the values with the API Key and API Key Secret (or OAuth 2.0 Client ID/Secret) from your Twitter App.
[!TIP] Adjust this configuration to use your preferred method for securely storing secrets in CI/CD pipelines.
Import the prebuilt provider component and integrate it into your UI:
import twitterOAuthButton from "@/components/authverse/twitterOAuthButton";
<twitterOAuthButton />;This component renders the Twitter sign-in option at its location.
https://example.com with your authenticated domain.