Working with Web Intents
Web Intents are the simplest way to let people Tweet or follow X accounts directly from your site. Web Intents automatically bring a viewer into the best logged-in experience to complete your specified action, including Tweet composers or X profile views inside X for iOS and X for Android apps. If a viewer does not have a X account they will have the opportunity to log in to X or create an account before completing the originally-specified action. Web Intents do not require setting up a X application, storing app credentials, or prompting a viewer for app permissions before posting. The X for Websites JavaScript will automatically fire appropriate JavaScript events when included on a webpage. Web Intents cannot be loaded inside an iframe. A X author must view the full webpage before deciding to author a new Tweet or Tweet action pre-populated by your specified Web Intent or follow a specified X account. Images for icons for likes, replies, and reposts are all available on our Image Resources page. Consult our Display Requirements for tips on rendering Tweets and other X resources. If your audience speaks a language other than English, we recommend you use localized intents.Get Started
Web Intents can be invoked flexibly through a light combination of JavaScript and HTML and are meant to be opened in a new window. The easiest way to use intents is to include the X for Websites JavaScript on any web page you wish to invoke an intent. If you’ve already set up the Tweet button, you’re already prepared for Web Intents. When combined with standard anchor tags and familiar iconography like the examples below, this JavaScript will automatically open a window of the appropriate size when clicked. You only need to loadplatform.x.com/widgets.js once.
List of Web Intents
Tweet or Reply to a Tweet
View the Tweet Web Intent documentation for more information about the Tweet intent.Retweet a Tweet
Retweets are a powerful way to enable your users to share your content with their followers.Supported Parameters
tweet_id
Like a Tweet
Users like for a variety of reasons: when they love a Tweet, when they want to save it for later, or to offer a signal of thanks. The like intent allows you to provide this Tweet action and follow up with relevant suggested accounts for the user to follow.Supported Parameters
tweet_id
Mini-Profile
This Intent provides an unobtrusive way to link names of people, companies, and services to their X accounts. The new tab prominently features the account’s profile picture, bio, recent tweets and an easy-to-use Follow button. More image resources.Supported parameters
screen_name
user_id
Follow
A follow Web Intent displays an inline sign in form for logged out users and follows the target X account on successful login.Localization
You may pass alang query parameter as part of any web intent to override the language display of a logged-in user or languages accepted by a browser. See X for Websites languages for a list of supported lang values.
Optimization
Limited Dependencies
Some sites may prefer to embed the unobtrusive web intents JavaScript inline or without a dependency toplatform.twitter.com. The snippet below will offer the equivalent functionality without the external dependency.