
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
bloggy-embed
Advanced tools
📝 bloggy-embed — Embeddable blog components for React for blog content rendering.
Easily showcase your blogs on any React-based website with beautiful prebuilt components like BlogCard
and BlogEmbed
.
npm install bloggy-embed
🚀 Usage Example
Below is an example of how to fetch blog data from your API and display it using bloggy-embed.
// src/App.tsx
import { useState, useEffect } from 'react';
import { BlogCard, BlogEmbed } from 'bloggy-embed';
import type { Blog } from 'bloggy-embed';
const API_URL = 'Your API';
function App() {
const [blogs, setBlogs] = useState<Blog[]>([]);
const [selectedBlog, setSelectedBlog] = useState<Blog | null>(null);
useEffect(() => {
fetch(API_URL)
.then((res) => res.json())
.then((data) => {
setBlogs(data.message.entries);
})
.catch((err) => {
console.error('Failed to fetch blogs:', err);
});
}, []);
return (
<div className="min-h-screen bg-gray-50 p-6">
<h1 className="text-4xl font-bold text-center mb-8">Latest Blogs</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{blogs.map((blog) => (
<BlogCard key={blog._id} blog={blog} onClick={() => setSelectedBlog(blog)} />
))}
</div>
{selectedBlog && (
<div className="fixed inset-0 bg-white z-50 overflow-y-auto px-4 py-6">
<BlogEmbed
blog={selectedBlog}
showBackButton
onBack={() => setSelectedBlog(null)}
/>
</div>
)}
</div>
);
}
export default App;
📚 Components
1️⃣ BlogCard
Displays a compact preview of a blog post.
| Prop | Type | Description |
| --------- | ------------ | ------------------------------------------------------- |
| `blog` | `Blog` | The blog object containing title, content, author, etc. |
| `onClick` | `() => void` | Callback when the card is clicked. |
2️⃣ BlogEmbed
Displays the full blog content.
| Prop | Type | Description |
| ---------------- | ------------ | ----------------------------------------- |
| `blog` | `Blog` | The blog object to render. |
| `showBackButton` | `boolean` | Whether to show a back button. |
| `onBack` | `() => void` | Callback when the back button is clicked. |
🔌 Blog Type Definition
The Blog type is included for convenience:
export interface Blog {
_id: string;
title: string;
content: any;
author?: string;
createdAt?: string;
coverImage?: string;
}
🎨 Styling
The components come with minimal default styles.
You can wrap them in your own CSS framework or Tailwind utility classes for customization.
FAQs
React components to embed blogs from an API.
The npm package bloggy-embed receives a total of 2 weekly downloads. As such, bloggy-embed popularity was classified as not popular.
We found that bloggy-embed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.