JSPM

  • Created
  • Published
  • Downloads 1512
  • Score
    100M100P100Q111175F
  • License MIT

Package Exports

  • @mars-stack/core
  • @mars-stack/core/auth/credential-tag
  • @mars-stack/core/auth/crypto-utils
  • @mars-stack/core/auth/csrf
  • @mars-stack/core/auth/hooks
  • @mars-stack/core/auth/internal-api-key
  • @mars-stack/core/auth/link-utils
  • @mars-stack/core/auth/middleware
  • @mars-stack/core/auth/password
  • @mars-stack/core/auth/reset-token
  • @mars-stack/core/auth/responses
  • @mars-stack/core/auth/session
  • @mars-stack/core/auth/types
  • @mars-stack/core/auth/validation
  • @mars-stack/core/auth/validators
  • @mars-stack/core/auth/verification
  • @mars-stack/core/database
  • @mars-stack/core/payments
  • @mars-stack/core/plugin
  • @mars-stack/core/plugin/builtin
  • @mars-stack/core/rate-limit
  • @mars-stack/core/seo
  • @mars-stack/core/storage
  • @mars-stack/core/test-utils
  • @mars-stack/core/utils/math
  • @mars-stack/core/version

Readme

@mars-stack/core

Core infrastructure for MARS apps -- auth, database, rate limiting, email, logging, and more.

Installation

yarn add @mars-stack/core

What's included

  • Auth -- Session management (JWE), CSRF protection, password hashing (bcrypt + SHA-256 prehash), input validation
  • Database -- Prisma proxy with structured error diagnostics
  • Rate limiting -- Upstash Redis with in-memory fallback
  • Email -- Provider-agnostic email service (SendGrid, Resend, console)
  • Logger -- Structured logging via Pino
  • Env -- Zod-based environment validation with human-readable errors
  • SEO -- Metadata helpers and JSON-LD generation
  • Test utils -- Mock factories, request helpers, render utilities

Usage

import { checkRateLimit, RATE_LIMITS } from '@mars-stack/core/rate-limit';
import { hashPassword, verifyPassword } from '@mars-stack/core/auth/password';
import { apiSchemas } from '@mars-stack/core/auth/validation';

License

MIT