🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@unbloque/blog-core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unbloque/blog-core

Core blog functionality with database adapters for Next.js

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

@unbloque/blog-core

Core blog functionality with database adapters for Next.js applications.

Installation

npm install @unbloque/blog-core

Quick Start

import { BlogService, MemoryAdapter } from '@unbloque/blog-core'

// Initialize with an adapter
const adapter = new MemoryAdapter()
const blog = new BlogService(adapter)

// Get all published posts
const posts = await blog.getPublishedPosts()

Database Adapters

Supabase

import { SupabaseAdapter } from '@unbloque/blog-core'

const adapter = new SupabaseAdapter(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
)

MongoDB

import { MongoDBAdapter } from '@unbloque/blog-core'

const adapter = new MongoDBAdapter(
  process.env.MONGODB_URI!,
  'blog' // database name
)

Neon (PostgreSQL)

import { NeonAdapter } from '@unbloque/blog-core'

const adapter = new NeonAdapter(
  process.env.DATABASE_URL!
)

API Reference

BlogService

  • getPublishedPosts() - Get all published posts
  • getAllPosts(includeUnpublished) - Get all posts
  • getPostBySlug(slug) - Get a single post by slug
  • getPostById(id) - Get a single post by ID
  • createPost(post) - Create a new post
  • updatePost(id, updates) - Update an existing post
  • deletePost(id) - Delete a post
  • searchPosts(query) - Search posts by query

Types

All TypeScript types are exported for use in your application:

import type { BlogPost, CreateBlogPost, UpdateBlogPost } from '@unbloque/blog-core'

License

MIT

Keywords

blog

FAQs

Package last updated on 04 Dec 2025

Did you know?

Socket

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.

Install

Related posts