Repository inventory

greendesertsnow/pocketbase-skills

Skills indexed from this repository, with install-style signals scoped to the repo.
1 skills0 GitHub stars0 weekly installsJavaScriptGitHubOwner profile

Overview

This skill provides concise PocketBase development best practices for designing collections, securing APIs, implementing auth flows, using the JavaScript SDK, optimizing queries, handling realtime subscriptions, managing files, and deploying to production. It distills prioritized rules and concrete recommendations to reduce common mistakes and improve performance and security.

How this skill works

The skill inspects common PocketBase tasks and offers targeted guidance: collection schema choices, API rule patterns, auth and token handling, SDK initialization and error handling, query optimization techniques, realtime subscription patterns, file upload/validation practices, and deployment considerations. Each recommendation is prioritized by impact so you can apply the highest-value changes first.

When to use it

  • Designing or refactoring collection schemas and relationships
  • Implementing or auditing API rules and access control
  • Building authentication: password, OAuth2, tokens, or MFA
  • Integrating the PocketBase JavaScript SDK in web or mobile apps
  • Improving query performance, expansion, and pagination
  • Adding realtime subscriptions or optimizing file uploads

Best practices

  • Choose appropriate field types: json for objects, select for enums, relation fields for links; add indexes on filtered/sorted fields
  • Default to locked API rules and open selectively; use @request.auth and @collection references for cross-collection checks
  • Use built-in auth flows: authWithPassword and configured OAuth2 providers; store and refresh tokens securely and enable MFA for sensitive apps
  • Initialize the SDK once and reuse the instance; use AsyncAuthStore in SSR/React Native and handle ClientResponseError with status checks
  • Avoid N+1 by using expand and back-relation queries; select only required fields and use cursor pagination or batch operations for large datasets
  • Subscribe only to needed records/collections, handle create/update/delete separately, and implement reconnection logic for realtime

Example use cases

  • Designing a user and posts schema: extend the auth collection for users and use relation fields for post authors
  • Locking an API endpoint so only owners can edit resources using @request.auth.id and @collection.owner
  • Integrating OAuth2 login in a single-page app and storing tokens with AsyncAuthStore for SSR
  • Improving list performance by expanding author relations and selecting only title and summary fields
  • Using realtime subscriptions to update a dashboard on create/update events with reconnect handling
  • Deploying PocketBase behind nginx, scheduling pb_data backups, and tuning SQLite settings for higher load

FAQ

Start locked and open endpoints selectively as you validate access patterns to minimize accidental public access.

How do I avoid N+1 queries?

Use query expand/back-relations to fetch related records in a single request and select only required fields.

1 skills

More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational