Simple state management that works everywhere. One hook, infinite possibilities with intelligent Auto Config System.No complex setup - just pure, intelligent state persistence.
Simple state management with intelligent Auto Config System
Automatically detects data patterns and optimizes persistence
const [filters, setFilters] = useSlugStore('filters', {
category: 'tech',
sort: 'newest'
}, {
autoConfig: true // 🎯 Automatic optimization
})One hook that works everywhere - client, server, anywhere
// Simple state management
const [state, setState] = useSlugStore('key', initialState, {
url: true, // Share via URL
offline: true, // Store offline
autoConfig: true // Auto-optimize
})Designed for AI-built applications with intelligent defaults
// AI can focus on business logic
// Not complex state setup
const [cart, setCart] = useSlugStore('cart', [])One hook for simple state management with automatic optimization
Import useSlugStore from slug-store/client
import { useSlugStore } from 'slug-store/client'
// That's it! Ready to use.Call useSlugStore with your key and initial state
function TodoApp() {
const [todos, setTodos] = useSlugStore('todos', [], {
url: true, // Share via URL
offline: true, // Store offline
autoConfig: true // Auto-optimize
})
}Your state is automatically persisted and optimized
// Use like useState
return (
<div>
{todos.map(todo => (
<div key={todo.id}>{todo.text}</div>
))}
<button onClick={() => setTodos([...todos, newTodo])}>
Add Todo
</button>
</div>
)Simple API that works everywhere - no complex setup needed
Shopping carts, wishlists, and product filters with automatic URL sharing
Analytics dashboards with shareable configurations and offline support
Document editors, note-taking apps, and content management systems
Game state, progress tracking, and settings with cross-device sync
Complex, non-persistent, hard to share
import { useState, useEffect } from 'react'
function Dashboard() {
const [filters, setFilters] = useState({ status: 'all', category: 'all' })
const [view, setView] = useState('grid')
const [data, setData] = useState([])
// Manual URL sync
useEffect(() => {
const params = new URLSearchParams(location.search)
if (params.has('filters')) {
setFilters(JSON.parse(params.get('filters')))
}
}, [])
useEffect(() => {
const url = new URL(window.location)
url.searchParams.set('filters', JSON.stringify(filters))
window.history.replaceState({}, '', url)
}, [filters])
// Can't share state easily
const shareState = () => {
// Complex sharing logic needed
}
}Simple, persistent, instantly shareable
import { useSlugStore } from 'slug-store/client'
function Dashboard() {
const [state, setState] = useSlugStore('dashboard', {
filters: { status: 'all', category: 'all' },
view: 'grid',
data: []
}, {
url: true, // Automatic URL sync
autoConfig: true // Automatic optimization
})
const updateFilters = (newFilters) => {
setState({
...state,
filters: { ...state.filters, ...newFilters }
})
// URL automatically updated!
}
// URL is already shareable!
return (
<div>
<select
value={state.filters.category}
onChange={(e) => updateFilters({ category: e.target.value })}
>
<option value="all">All Categories</option>
<option value="tech">Tech</option>
</select>
</div>
)
}