About: - JavaScript <3
- I make silly libraries
- Building Abell, A new static-site-generator.
Location:
Bengaluru, India 🇮🇳
Joined:
May 31, 2019
I made a Profile Card Widget for Bluesky 🦋
Publish Date: Nov 24 '24
8 0
Hey there! 👋 It’s been a while since my last post here—four years, to be exact. But I’m back, excited to share something cool I built: a Profile Card Widget for Bluesky!
Lets get to the topic! I recently joined Bluesky and I was exploring their APIs and I realised, what if we could render our bluesky's profile into our websites.
This is something that I had done in the past by creating dev.to widget for this platform.
Just like dev.to widget, I want bsky-widget to work in all frameworks and setups without me having to write libraries for each and every one of them so I went with the same approach as dev.to widget, web components!!
I'll probably write a different article on web components if you all are interested. Until then, here's how you can use bsky-widget
Here's how it looks like
How to use bsky-widget?
In Vanilla Projects
You just need 2 lines of code to use bsky-widget
<!-- Use your bluesky profile handle --><bsky-widgethandle="srbh.dev"></bsky-widget><!-- Paste before end of body --><script
src="https://unpkg.com/bsky-widget@~0.1/dist/index.js"type="module"></script>
In Frameworks
In frameworks, you can skip adding <script src=""> and instead follow this-
npm install--save bsky-widget@latest
// along with other imports of frameworkimport'bsky-widget';// Wherever you want to render the card<bsky-widgethandle="srbh.dev"></bsky-widget>
<!-- Paste in your CSS to avoid layout shift --><style>
bsky-widget {
min-height: 387px;
width: 350px;
}
</style><!-- Paste wherever you want to render the card --><bsky-widgethandle="patak.dev"></bsky-widget><!-- Paste before end of body --><scriptsrc="https://unpkg.com/bsky-widget@~0.1/dist/index.js"
type="module"
></script>