Agent skill

Pocketbase JS SDK

by pockethost in pockethost/pockethost

Uses the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD, realtime subscribe, file uploads, and pb.send for custom routes.

MITAuto-check passedBackend & APIs

Install Pocketbase JS SDK

skills CLI
$ npx skills add pockethost/pockethost --skill pocketbase-js-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install pockethost/pockethost pocketbase-js-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/pockethost/pockethost.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/pocketbase-js-sdk .claude/skills/pocketbase-js-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pocketbase-js-sdk
GitHub stars
1.4k
Token cost
~1k tokens
SKILL.md length
214 words
Files
2
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Uses the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD, realtime subscribe, file uploads, and pb.send for custom routes.

  • Writing client apps
  • SKILL.md covers Not the JSVM, Basic usage, Auth patterns and Realtime, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Node scripts that call PocketBase over HTTP with async/await — not pbhooks

What it does

Pocketbase JS SDK is an agent skill from pockethost/pockethost. Uses the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD, realtime subscribe, file uploads, and pb.send for custom routes. Use when writing client apps, dashboard code, or Node scripts that call PocketBase over HTTP with async/await — not pbhooks.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `pockethost-client.md`).

It sits in Backend & APIs, covering File uploads and storage and Async programming. It works with JavaScript and npm. The repository describes itself as: Open source multitenant PocketBase server. The licence is MIT.

When your agent uses it

  • Writing client apps
  • Node scripts that call PocketBase over HTTP with async/await — not pbhooks

Example prompts

  • “Use the pocketbase-js-sdk skill to use the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD…”
  • “/pocketbase-js-sdk”

What it can do on your machine

Read from SKILL.md and the folder at commit 82c9ba3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pocketbase JS SDK loads about 1k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 214 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from pockethost/pockethost at commit 82c9ba3, republished under its MIT licence (© pockethost). 214 words, ~1,018 tokens.

Download SKILL.mdSave it as .claude/skills/pocketbase-js-sdk/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
pocketbase-js-sdk
description
Uses the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD, realtime subscribe, file uploads, and pb.send for custom routes. Use when writing client apps, dashboard code, or Node scripts that call PocketBase over HTTP with async/await — not pb_hooks.

PocketBase JavaScript SDK

The npm pocketbase package is an async HTTP client for PocketBase. It runs in browsers and Node — not inside the JSVM.

Official SDK: https://github.com/pocketbase/js-sdk

Not the JSVM

JS SDKJSVM (pb_hooks)
async/await, PromisesSynchronous only
new PocketBase(url)$app, routerAdd, onRecord*
Browser / NodeEmbedded in PocketBase binary

Never use async/await or new PocketBase() inside *.pb.js hook files.

Basic usage

ts
import PocketBase from 'pocketbase'

const pb = new PocketBase('https://my-project.pockethost.io')

// Auth
await pb.collection('users').authWithPassword(email, password)
pb.authStore.isValid // true when logged in
pb.authStore.model   // auth record
pb.authStore.clear() // logout

// CRUD
const list = await pb.collection('posts').getList(1, 50, { filter: 'status = "published"' })
const one = await pb.collection('posts').getOne('RECORD_ID')
await pb.collection('posts').create({ title: 'Hello' })
await pb.collection('posts').update('RECORD_ID', { title: 'Updated' })
await pb.collection('posts').delete('RECORD_ID')

Auth patterns

ts
// Register (auth collection)
await pb.collection('users').create({ email, password, passwordConfirm: password })

// OAuth2
await pb.collection('users').authWithOAuth2({ provider: 'google' })

// Refresh token
await pb.collection('users').authRefresh()

// Listen for auth changes
pb.authStore.onChange((token, model) => { /* ... */ })

Realtime

ts
const unsub = await pb.collection('posts').subscribe('*', (e) => {
  console.log(e.action, e.record)
})
// later
unsub()

Always unsubscribe on component teardown to avoid leaks.

Custom routes (hooks → client)

Hooks registered with routerAdd are called from the client via pb.send():

ts
const result = await pb.send('/test/theTestId', { method: 'POST' })

Auth headers are attached automatically when authStore is valid.

JSON body shape

Pass a plain object as body. The SDK serializes it as JSON with the correct Content-Type:

ts
await pb.send('/api/user/trusted-ips', {
  method: 'PATCH',
  body: { trusted_ips: ['203.0.113.5/32'] },
})

On the hook side (≥ v0.23), read with e.bindBody(new DynamicModel({ trusted_ips: [] })) — not manual JSON.parse on e.request.body. See pocketbase-jsvm request-body.md.

File uploads

ts
const formData = new FormData()
formData.append('title', 'Photo')
formData.append('image', file)
await pb.collection('photos').create(formData)

Errors

ts
import { ClientResponseError } from 'pocketbase'

try {
  await pb.collection('posts').create(data)
} catch (err) {
  if (err instanceof ClientResponseError) {
    console.log(err.status, err.response)
  }
}

Architecture note

Prefer direct client → PocketBase access with API rules. Avoid proxying through SvelteKit/Next server loaders unless you have a specific reason (see pocketbase skill, antipattern doc).

For privileged operations, add a JS hook route and call it with pb.send() instead of server-side SDK calls.

This monorepo

Import SDK types and class from pockethost/common, not directly from pocketbase:

ts
import { PocketBase, ClientResponseError, BaseAuthStore } from 'pockethost/common'

Prefer factory wrappers over raw new PocketBase() in app code. See pockethost-client.md.

SDK reference

© pockethost, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .cursor/skills/pocketbase-js-sdk of pockethost/pockethost.

  • SKILL.md
  • pockethost-client.md

Open the folder on GitHubat commit 82c9ba3

Compare with similar skills

Pocketbase JS SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pocketbase JS SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pocketbase JS SDK this skillpockethost/pockethost1.4k—~1kAutomated safety check: PassMIT
Javascript SDKaiskillstore/marketplace4301 repos~3.3kAutomated safety check: PassNone
Gemini Live API Devgoogle-gemini/gemini-skills4.3k—~4.6kAutomated safety check: PassApache-2.0
Linea Dependency MaintenanceConsensys-Incorporated/linea-attestation-registry1771 repos~3.7kAutomated safety check: WarnMIT
Remixepicweb-dev/epicflare127—~6.3kAutomated safety check: PassNone
Sasjs Adaptersasjs/core132—~2.6kAutomated safety check: PassMIT

Similar skills

  • Javascript SDK

    aiskillstore/marketplace

    JavaScript/TypeScript SDK for inference.sh - run AI apps, build agents, integrate with all models.

    430 GitHub starsUsed in 1 repo~3.3k tokens
    Backend & APIsAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Linea Dependency Maintenance

    Consensys-Incorporated/linea-attestation-registry

    Safely plan and execute dependency maintenance for JavaScript/TypeScript (npm, pnpm) and GitHub Actions, including npm lockfiles, pnpm workspaces, catalogs, overrides, SHA-pinned action versions…

    177 GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: warnings
  • Remix

    epicweb-dev/epicflare

    Build and review Remix 3 applications using the remix npm package and subpath imports.

    127 GitHub stars~6.3k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Sasjs Adapter

    sasjs/core

    Frontend/Node integration with SAS backends using @sasjs/adapter - configuring the SASjs class, the exact request() inputs and response shape, authentication, file upload, and session management.

    132 GitHub stars~2.6k tokensUpdated 4 days ago
    Backend & APIsAuto-check passed
  • Build Perf Baseline

    dotnet/skills

    Official

    Establish MSBuild/.NET build performance baselines before optimizing.

    5.6k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed

More from pockethost/pockethost

All 11 skills in this repo
  • Blog Voice

    pockethost/pockethost

    Write PocketHost blog posts in Ben Allfree's voice (@cap'n).

    1.4k GitHub stars~977 tokensUpdated 11 days ago
    Auto-check passed
  • Check Push

    pockethost/pockethost

    Run pnpm check:push (lint, types, tests) before git push or PR-ready work.

    1.4k GitHub stars~665 tokensUpdated 11 days ago
    Auto-check passed
  • Commit

    pockethost/pockethost

    Create scoped git commits from the current conversation (e.g.

    1.4k GitHub stars~1.3k tokensUpdated 11 days ago
    Auto-check: notes
  • Feature Blog

    pockethost/pockethost

    Ship user-facing PocketHost features with a blog post instead of semver release notes.

    1.4k GitHub stars~818 tokensUpdated 11 days ago
    Auto-check passed
  • Lemon Squeezy Integration

    pockethost/pockethost

    Full Lemon Squeezy integration — REST API, @lemonsqueezy/lemonsqueezy.js server SDK, Lemon.js checkout overlays, webhooks, customdata, and subscriptions.

    1.4k GitHub stars~1.1k tokensUpdated 11 days ago
    Auto-check passed
  • Pocketbase

    pockethost/pockethost

    Models PocketBase backends: collections, relations, auth, API rules, migrations, and architecture.

    1.4k GitHub stars~1k tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Pocketbase JS SDK

What does Pocketbase JS SDK do?

Uses the official PocketBase JavaScript SDK (npm pocketbase) from browser or Node: authStore, collection CRUD, realtime subscribe, file uploads, and pb.send for custom routes. Pocketbase JS SDK is an agent skill from pockethost/pockethost.send for custom routes.

When should I use Pocketbase JS SDK?

Pocketbase JS SDK fits situations like: writing client apps; Node scripts that call PocketBase over HTTP with async/await — not pbhooks.

How do I install Pocketbase JS SDK in Claude Code?

Run `npx skills add pockethost/pockethost --skill pocketbase-js-sdk -a claude-code`. Or copy the skill folder (.cursor/skills/pocketbase-js-sdk in pockethost/pockethost) into .claude/skills/pocketbase-js-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Pocketbase JS SDK in Codex?

Run `npx skills add pockethost/pockethost --skill pocketbase-js-sdk -a codex`. Or copy the skill folder (.cursor/skills/pocketbase-js-sdk in pockethost/pockethost) into .agents/skills/pocketbase-js-sdk in your project. Codex loads it when a task matches its description.

Can I use Pocketbase JS SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add pockethost/pockethost --skill pocketbase-js-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pocketbase-js-sdk, .gemini/skills/pocketbase-js-sdk, .github/skills/pocketbase-js-sdk and .opencode/skills/pocketbase-js-sdk in your project.

What does Pocketbase JS SDK need to run?

SKILL.md names no scripts, command-line tools or credentials: Pocketbase JS SDK is instructions for the agent only.

Does Pocketbase JS SDK access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Pocketbase JS SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Pocketbase JS SDK use?

Pocketbase JS SDK is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pocketbase JS SDK use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Pocketbase JS SDK?

Skills that share tags, products or a category with Pocketbase JS SDK: Javascript SDK (aiskillstore/marketplace, 430 stars), Gemini Live API Dev (google-gemini/gemini-skills, 4.3k stars), Linea Dependency Maintenance (Consensys-Incorporated/linea-attestation-registry, 177 stars) and Remix (epicweb-dev/epicflare, 127 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pocketbase JS SDK?

pockethost (a GitHub organization) maintains it in pockethost/pockethost, which has 1,444 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 28, 2026.

Source: pockethost/pockethost on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.