Spark Plus Packages
Spark Plus is a collection of 14 production-ready Dart packages for building robust backend applications. Each package works standalone or together as a complete ecosystem.
Core Utilities
Foundational packages for common backend needs.
- env — Type-safe environment variable loading from .env files
- errors — Structured exceptions with HTTP status codes
- kd_bcrypt — Pure Dart bcrypt hashing with timing-safe verification
- kd_totp — TOTP/HOTP two-factor authentication (RFC 6238/4226)
- user_agent — Browser, OS, device detection and bot identification
Feature Packages
Full-featured modules for authentication, file management, and user profiles.
- auth — Email/password + OAuth2 authentication with JWT tokens
- media — File uploads with S3, R2, and local storage backends
- users — User profile management with auth integration
Middleware
Composable Shelf middleware for security, logging, and session management.
- spark_logging — Structured logging with pluggable handlers
- spark_cors — CORS middleware with dynamic origin matching
- spark_csrf — CSRF token generation and validation
- spark_rate_limiter — Rate limiting by IP with path-specific rules
- spark_session — Cookie-based sessions with multiple store backends
- spark_security_headers — CSP, HSTS, and security headers middleware
Recommended Stacks
Authentication Stack
auth + users + spark_session + spark_csrf + spark_cors + spark_logging
API Server
errors + env + auth + spark_rate_limiter + spark_logging + spark_security_headers
File Sharing App
auth + users + media + spark_session + spark_logging
2FA Integration
auth + kd_totp + users + spark_session