Skip to content

Instantly share code, notes, and snippets.

@whoisryosuke
Created May 1, 2025 04:28
Show Gist options
  • Save whoisryosuke/d48090cdd184e17785d2921c9a1dbd5e to your computer and use it in GitHub Desktop.
Save whoisryosuke/d48090cdd184e17785d2921c9a1dbd5e to your computer and use it in GitHub Desktop.
React - Bluesky Embed
import React, { PropsWithChildren } from "react";
type Props = {
id: string;
userId: string;
};
// <BlueskyEmbed id="3lmcux5cabv2i" userId="itayxaatwwlwww4fp3jac3nn" />
const BlueskyEmbed = ({ id, userId, children }: PropsWithChildren<Props>) => {
const uri = `at://did:plc:${userId}/app.bsky.feed.post/${id}`
return (
<div style={{ marginBottom: "3rem", display: "flex" justifyContent: "center"}}>
<blockquote
className="bluesky-embed"
data-bluesky-uri={uri}
data-bluesky-cid="bafyreiflt6p6c77vxtubpa4aev2qzilnkntxjbxx5x34x5yovs2afazyta"
data-bluesky-embed-color-mode="system"
>
{children}
</blockquote>
<script
async
src="https://embed.bsky.app/static/embed.js"
charSet="utf-8"
/>
</div>
);
};
export default BlueskyEmbed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment