Sharing Features
GitHub Wrapped includes built-in sharing capabilities to help users showcase their year-in-code achievements on social media and share links with friends and colleagues.Social Media Sharing
Twitter/X Integration
Every wrapped visualization includes a dedicated “Share on X” button that opens a pre-populated tweet. Implementation (components/WrappedSlide.tsx:1225-1236):
- User clicks “Share on X” button on the final slide
- Opens Twitter in a new tab with pre-filled tweet
- Tweet includes:
- Custom message with repository name and year
- Direct link to the wrapped visualization
- Celebratory emoji
Tweet Customization
- Repository Wrapped
- User Wrapped
- Blue background (#1DA1F2 - Twitter brand color)
- White text
- Hover animation (scale: 1.05)
- Tap animation (scale: 0.95)
- Shadow effect for depth
Link Copying
Clipboard API Integration
The “Copy Link” button allows users to quickly copy the wrapped URL to their clipboard. Implementation (components/WrappedSlide.tsx:1241-1246):
- Uses modern Clipboard API
- Checks for browser support before attempting
- Provides immediate feedback via alert
- Copies current page URL
- Border color matches slide theme
- Text color matches slide theme
- Hover and tap animations
- Rounded full button style
Browser Compatibility
The Clipboard API requires a secure context (HTTPS) in production. The code includes safety checks to gracefully handle unsupported browsers.
navigator.clipboard is unavailable, the button click has no effect. Consider implementing a fallback:
Open Graph Image Generation
GitHub Wrapped automatically generates Open Graph (OG) images for rich social media previews.OG Image Endpoint
Route:/api/og/route.tsx
Runtime: Edge (Vercel)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
owner | string | Yes | Repository owner username |
repo | string | Yes | Repository name |
year | string | No | Year (defaults to current year) |
Image Design
The OG image features:Dimensions
- Width: 1200px
- Height: 630px
- Optimized for Twitter, Facebook, LinkedIn
Visual Elements
Background
- Dark theme (zinc-950: #09090b)
- Radial gradient overlay
- Subtle grid pattern (50px squares)
Content Card
- Centered card with border
- Semi-transparent background
- Rounded corners (30px)
- Drop shadow for depth
GitHub Icon
- SVG icon (48x48px)
- Stroke-based design
- Positioned next to “GitHub Wrapped” text
Typography
- Large repository name (72px, bold)
- Year badge with pill styling
- “GitHub Wrapped” branding
Color Scheme
Implementation Using @vercel/og
The
@vercel/og library uses Satori under the hood to convert React components to SVG, then to PNG. It supports a subset of CSS and HTML.Meta Tags Integration
Repository Wrapped Metadata
The wrapped page automatically includes rich meta tags (app/wrapped/[owner]/[repo]/[year]/page.tsx:91-134):
Rendered HTML
This generates the following meta tags:Social Media Previews
- Twitter/X
- Facebook
- LinkedIn
- Slack/Discord
- Uses
summary_large_imagecard type - Displays 1200x630 image
- Shows title and description below image
- Includes site name if configured
Share Button Positioning
Sharing options appear on the final slide of both repository and user wrapped stories. Layout:- Mobile (< 640px): Stacked vertically
- Desktop: Side-by-side
- Equal flex distribution
- Consistent gap spacing
Future Enhancements
More Platforms
Add LinkedIn, Reddit, Hacker News sharing buttons
Custom OG Images
Generate personalized OG images with actual stats
Download as Image
Export wrapped slides as PNG/SVG
Embed Codes
Provide iframe embeds for websites/blogs