Repository navigation
Releases
Releases · lalitgehani/SnackBase-sdk-js
v0.2.0
🏗️ Infrastructure & Build
- Monorepo migration: Migrated to a pnpm monorepo with a shared
@snackbase/tsconfigpackage. - Vitest workspace: Structured unit and integration test configurations.
- Public publishing: Added
publishConfigwithaccess: "public"toreact,sdk, andskillspackages. - CI cleanup: Removed legacy GitHub Actions CI and release workflows.
- Monorepo cleanup: Removed root
tsconfig, updated.gitignore, and dropped the@snackbase/examplespackage.
📦 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, andvoting. - CLI flags for Git initialization, dependency installation, and non-interactive mode.
- Included in all monorepo build and dev scripts.
✨ SDK Enhancements
Authentication Overhaul
TokenTypeenum 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, trackstoken_type, exposes session type checks (isSuperadmin,isApiKeySession,isPersonalTokenSession,isOAuthSession).- Client getters: All session flags and
tokenTypeexposed directly onSnackBaseClient. - Auth error interceptor (
createAuthErrorInterceptor): Handles API key restrictions and preserves auth redirect details. - Optional
systemAccountIdoverride 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
useAuthhook now exposestokenType,isSuperadmin,isApiKeySession,isPersonalTokenSession, andisOAuthSession.
API Key Service
- List parameters, masked key formatting, explicit revoke response handling.
- Updated to use new endpoint paths (
/api/snackbase/api-keys).
Audit Logs
AuditLoginterface now includesextra_metadatawithauth_methodfor 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_defaultfield 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.
AdminServicefully documented with default provider methods.
🔧 Bug Fixes & Refactors
- Auth service test payloads aligned to snake_case (
account,refresh_tokens). defaultfield schema enhanced with a description.- GitHub repository URLs updated across documentation.
v0.1.1
Added
- Initial release of SnackBase SDK for JavaScript/TypeScript
Features
- Core Client:
SnackBaseClientwith configuration validation - HTTP Client: Fetch-based HTTP client with interceptors
- Authentication: Email/password, OAuth, SAML, and API key authentication
- Services: 17+ service classes for all SnackBase resources
- Accounts, Users, Collections, Records
- Roles, Collection Rules (Permission System V2)
- Groups, Invitations, Macros
- API Keys, Audit Logs, Dashboard, Admin
- Email Templates, Files
- Real-Time: WebSocket/SSE support with automatic reconnection
- Query Builder: Fluent API for complex queries
- React Integration: Context provider and hooks
useAuth,useQuery,useRecord,useMutation,useSubscription
- Type Safety: Complete TypeScript definitions
- Error Handling: Typed error hierarchy
- Storage Abstraction: Platform-agnostic storage backends
- Logging: Structured logging system with configurable levels
Package Exports
@snackbase/sdk- Core SDK@snackbase/sdk/react- React integration
Build Output
- ESM (
.mjs) - 14.87 KB gzipped - CommonJS (
.js) - TypeScript declarations (
.d.ts)
[0.1.1] - 2026-01-24
Added
- Initial beta release
- Core SDK features
- React hooks
- Real-time subscriptions
- Query builder
- 231 tests passing
[Future Releases]
Planned
- Integration tests with test server
- Performance benchmarks
- Request deduplication
- Advanced caching strategies
- Vue 3 integration
- Angular integration
- Svelte integration