Threads & Bluesky Federated Social Embeds Guide
To embed Meta Threads and Bluesky posts with optimal performance, build zero-tracking CSS cards matching each platform's visual identity: Threads' minimalist monochrome typography and Bluesky's cerulean butterfly aura (#1185FE). For Bluesky, public posts can be retrieved directly from the decentralized AT-Protocol public API (public.api.bsky.app) without API key requirements.
Decentralized social networks on the AT-Protocol let developers query public posts with open REST APIs. No API keys, no walled gardens.
Step 1: Querying Public Bluesky Posts via Open AT Protocol API
Unlike closed social platforms, Bluesky's AT Protocol allows developers to fetch public post threads directly from `public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?uri={at_uri}` with no API keys or developer accounts required.
async function fetchBlueskyPost(did, rkey) {
const uri = `at://${did}/app.bsky.feed.post/${rkey}`;
const endpoint = `https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread?uri=${encodeURIComponent(uri)}`;
const res = await fetch(endpoint);
if (!res.ok) throw new Error(`Bluesky API HTTP ${res.status}`);
const data = await res.json();
const post = data.thread.post;
return {
author: post.author.displayName,
handle: post.author.handle,
avatar: post.author.avatar,
text: post.record.text,
likes: post.likeCount,
reposts: post.repostCount
};
}
Step 2: Building a Minimalist Threads Post Embed Card in CSS
Meta Threads features an ultra-clean, high-contrast monochrome design with subtle 1px border outlines and clean typography. Replicate Threads' signature typography using `-apple-system, BlinkMacSystemFont`.
.threads-post-card {
background: #101010;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 16px;
padding: 1.25rem 1.5rem;
color: #f3f5f7;
max-width: 440px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.threads-logo-icon {
width: 20px;
height: 20px;
fill: #f3f5f7;
}
.threads-actions {
display: flex;
gap: 1.25rem;
color: #777777;
font-size: 0.85rem;
margin-top: 0.75rem;
}
Step 3: Implementing Privacy-First Zero-Tracking Embed Standards
Both Threads and Bluesky card widgets can be deployed as static HTML with zero external tracking cookies. This provides 100% compliance with GDPR and CCPA without requiring cookie banner consent.
Privacy Architecture Checklist:
1. No external script tags (no embeds.threads.net or bsky.app JS)
2. Images proxied or hosted locally to prevent IP address leakage
3. Links carry rel="noopener noreferrer"
4. Layout stability guaranteed via aspect-ratio containment
Step 4: Formatting Rich Text Mentions, Hashtags, and External Links
Bluesky AT-Protocol posts store rich text facets (character indices mapping to links, mentions, and tags). Processing these facets client-side or during build time turns raw text into accessible, interactive hyperlink anchors.
function parseBlueskyFacets(text, facets = []) {
if (!facets.length) return text;
let formatted = text;
// Sort facets in reverse order to preserve string byte offsets
facets.sort((a, b) => b.index.byteStart - a.index.byteStart);
for (const facet of facets) {
const { byteStart, byteEnd } = facet.index;
const feature = facet.features[0];
const segment = text.slice(byteStart, byteEnd);
if (feature.$type === 'app.bsky.richtext.facet#link') {
formatted = formatted.slice(0, byteStart) +
`<a href="${feature.uri}" target="_blank" rel="noopener">${segment}</a>` +
formatted.slice(byteEnd);
}
}
return formatted;
}
Next-Level Addons: Elevating Your Implementation
Take this technique further by combining it with complementary design token studios and animation tools:
Here's my golden rule when implementing this in production: test across multiple devices and browsers early. Keep your DOM hierarchy shallow, optimize assets with modern formats (like WebP/AVIF), and verify keyboard navigation for accessibility.
Frequently Asked Questions
Practical answers to common implementation questions, browser quirks, and performance tips.
Do I need an API key to fetch Bluesky posts for embed cards?
No. Bluesky's AT Protocol public XRPC endpoints (`public.api.bsky.app`) are completely open for reading public posts without authentication or API tokens.
How do I obtain the AT URI for a specific Bluesky post?
A Bluesky post URL follows the format `https://bsky.app/profile/{handle}/post/{rkey}`. You can resolve the handle to a DID via `com.atproto.identity.resolveHandle` and construct `at://{did}/app.bsky.feed.post/{rkey}`.
Can Meta Threads posts be embedded natively on third-party websites?
Meta offers an official iframe embed via `https://www.threads.net/embed.js`, but static zero-JS cards provide far better performance and zero layout shift.
How does Bluesky handle custom domains as user handles?
Users can link their personal domain (e.g. `alex.dev`) to their Bluesky account via DNS TXT records (`_atproto.alex.dev`), providing cryptographic identity verification.
Are images in Bluesky posts cached on a public CDN?
Yes, images in public Bluesky feeds are hosted on Cloudflare-backed CDNs at `cdn.bsky.app/img/feed_thumbnail/plain/{did}/{cid}@jpeg`.