{"library":"react-tweet","title":"React Tweet Embeds","description":"react-tweet is a library maintained by Vercel that enables seamless embedding of individual tweets into React applications, supporting various build tools like Next.js and Vite. It provides components for rendering tweets, including media, and utilities for fetching tweet data. The current stable version is 3.3.0. The package maintains an active release cadence, frequently pushing minor updates and bug fixes, often in response to changes in the underlying X (formerly Twitter) platform's API or styling. Key differentiators include its tight integration with the Vercel ecosystem, built-in styling for a consistent look, and a focus on providing a reliable way to display tweet content that often faces challenges due to Twitter's evolving API access and rate limits.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-tweet"],"cli":null},"imports":["import { Tweet } from 'react-tweet/components';","import { getTweet } from 'react-tweet/api';","import { TweetSkeleton } from 'react-tweet/components';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { Tweet } from 'react-tweet/components';\nimport { getTweet } from 'react-tweet/api';\n\n// This component is designed for server-side fetching (e.g., Next.js Server Components)\n// or client-side fetching with appropriate state management.\nasync function MyTweetEmbed({ id }: { id: string }) {\n  const tweet = await getTweet(id);\n\n  if (!tweet) {\n    return <p>Tweet not found or private.</p>;\n  }\n\n  return (\n    <div style={{\n      display: 'flex',\n      justifyContent: 'center',\n      width: '100%',\n      margin: '20px 0'\n    }}>\n      <Tweet rawTweet={tweet} />\n    </div>\n  );\n}\n\n// Example usage in a React component:\n// <MyTweetEmbed id=\"1713028308833912089\" />\n// Remember to call `getTweet` in a server component or `useEffect` for client components.","lang":"typescript","description":"Demonstrates fetching a tweet using `getTweet` and rendering it with the `Tweet` component, suitable for SSR/SSG contexts.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}