Skip to content

v0.2.0

Pre-release
Pre-release

Choose a tag to compare

@lalitgehani lalitgehani released this 21 Feb 18:01
· 58 commits to main since this release

🏗️ Infrastructure & Build

  • Monorepo migration: Migrated to a pnpm monorepo with a shared @snackbase/tsconfig package.
  • Vitest workspace: Structured unit and integration test configurations.
  • Public publishing: Added publishConfig with access: "public" to react, sdk, and skills packages.
  • CI cleanup: Removed legacy GitHub Actions CI and release workflows.
  • Monorepo cleanup: Removed root tsconfig, updated .gitignore, and dropped the @snackbase/examples package.

📦 New Packages

@snackbase/mcp — MCP Server

A full MCP (Model Context Protocol) server with stdio transport. Ships with the following tools:

Tool Capabilities
snackbase_collections CRUD, export, and import collection schemas
snackbase_records CRUD operations on collection records
snackbase_access_rules Get, update, validate, and test collection access rules
snackbase_users CRUD, password management, email verification
snackbase_groups Group and membership management
snackbase_roles Role management
snackbase_accounts Account management
snackbase_invitations User invitation management
snackbase_api_keys List, create, and revoke API keys
snackbase_admin Manage configurations, providers, and default provider
snackbase_dashboard Get server stats
snackbase_audit_logs Query, view, and export audit trail data
snackbase_email_templates List, get, update, render, send test, and view logs
snackbase_macros CRUD and test SQL macros
snackbase_migrations Query migration status and history

create-snackbase-app — Project Scaffolding CLI

  • Scaffolds new SnackBase projects from templates: todo, todo-single-tenant, realtime, and voting.
  • CLI flags for Git initialization, dependency installation, and non-interactive mode.
  • Included in all monorepo build and dev scripts.

✨ SDK Enhancements

Authentication Overhaul

  • TokenType enum integrated into user and auth state interfaces.
  • Core constants defined for system account ID, token prefixes, and API key paths.
  • Token utilities: Detection, validation, masking, and superadmin checks.
  • AuthManager: Detects token types, tracks token_type, exposes session type checks (isSuperadmin, isApiKeySession, isPersonalTokenSession, isOAuthSession).
  • Client getters: All session flags and tokenType exposed directly on SnackBaseClient.
  • Auth error interceptor (createAuthErrorInterceptor): Handles API key restrictions and preserves auth redirect details.
  • Optional systemAccountId override added to SDK configuration.

New Error Classes

  • ApiKeyRestrictedError: Raised when an API key lacks the required scope. Includes default suggestions.
  • EmailVerificationRequiredError: Raised when email verification is required to proceed.
  • Both are exported from the SDK package.

React SDK

  • useAuth hook now exposes tokenType, isSuperadmin, isApiKeySession, isPersonalTokenSession, and isOAuthSession.

API Key Service

  • List parameters, masked key formatting, explicit revoke response handling.
  • Updated to use new endpoint paths (/api/snackbase/api-keys).

Audit Logs

  • AuditLog interface now includes extra_metadata with auth_method for richer audit trails.
  • PDF export support added.

Collections & Records

  • Collection export/import with new types and service methods.
  • File upload API updated.
  • Refined query builder syntax.

🛡️ Admin Service

  • Set or unset a configuration as the default provider for its type.
  • is_default field support in configuration listings.

🧠 Skills Package

  • Added a comprehensive SnackBase JS/TS SDK skill with full documentation and rules.
  • Reorganized docs to references/ with a dedicated API reference.
  • Added skill installation script.
  • AdminService fully documented with default provider methods.

🔧 Bug Fixes & Refactors

  • Auth service test payloads aligned to snake_case (account, refresh_tokens).
  • default field schema enhanced with a description.
  • GitHub repository URLs updated across documentation.