PocketBase for Openclaw

A comprehensive skill for AI agents to build and manage backends using PocketBase collections, authentication, and realtime data synchronization.

ivangdavila
v1.0.0
Feb 10, 2026
2
1.4k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install pocketbase

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install pocketbase using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is PocketBase?

PocketBase is an open-source backend solution that combines an embedded database with real-time capabilities and file storage. This skill provides a structured approach for AI agents to interact with the PocketBase SDK, ensuring best practices for authentication, data fetching, and event-driven updates. By integrating this into your Openclaw Skills library, you can automate the creation and maintenance of lightweight, high-performance backends.

The skill focuses on the JavaScript SDK implementation, offering guidance on efficient data modeling and secure access control. It enables developers to leverage the full power of PocketBase, from simple CRUD operations to complex server-side hooks and admin-level API management, all within a unified Openclaw Skills workflow.

PocketBase Use Cases

  • Building rapid prototypes with a fully functional backend and auth system.
  • Implementing real-time dashboards or chat applications using the subscription model.
  • Automating user management and OAuth2 authentication flows.
  • Managing file storage and secure document uploads for web and mobile apps.
  • Creating server-side logic using JavaScript hooks for custom business requirements.

How PocketBase Works

  1. Initialize the PocketBase client and verify the validity of the authentication store.
  2. Access specific collections to perform CRUD operations using SQL-like filters and relationship expansion.
  3. Handle user authentication via email/password or third-party OAuth providers, with tokens automatically managed by the SDK.
  4. Subscribe to real-time events to receive immediate notifications on record creations, updates, or deletions.
  5. Deploy server-side hooks in the hooks directory to intercept and modify requests synchronously.
  6. Use administrative endpoints for superuser tasks like collection schema modifications.

PocketBase Setup

To use this within the Openclaw Skills framework, ensure the PocketBase binary is available in your environment and install the JavaScript SDK.

npm install pocketbase
# Ensure you do not import from pocketbase/dist

Initialize the client with your instance URL:

import PocketBase from 'pocketbase';
const pb = new PocketBase('http://127.0.0.1:8090');

PocketBase Data Schema & Taxonomy

The skill manages data across collections and local state. Below is the primary organizational structure:

Component Description Data Format
Collections Data tables with specific rules JSON Records
AuthStore Client-side token and user state LocalStorage / Cookie
File Fields Multipart data storage FormData / Blob
Hooks Server-side JavaScript logic .pb.js files
Filters SQL-like query strings String (e.g., 'status = "active"')

PocketBase Advanced Features

  • Multi-relation expansion to retrieve nested data in a single request without manual joins.
  • Granular API rules using @request.auth.id for secure, owner-based access control.
  • Real-time cleanup patterns to prevent memory leaks by properly unsubscribing from event streams.
  • Dedicated Admin API access for automating backend configuration and management.
  • Custom server-side logic via JavaScript hooks that run synchronously with the request lifecycle.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*