Skip to main content

@helix/shared/constants

Shared constants for the Helix platform.

Overview

Platform-wide constants for:

  • Default values (pagination, cache TTL)
  • Error codes (structured error handling)
  • Rate limits (per role)

Installation

import {
DEFAULT_PAGE_SIZE,
ERROR_CODES,
RATE_LIMITS,
} from '@helix/shared/constants';

Usage

Defaults

const pageSize = DEFAULT_PAGE_SIZE; // 20
const maxSize = MAX_PAGE_SIZE; // 100
const cacheTTL = SESSION_CACHE_TTL_SECONDS; // 1800

Error Codes

throw new AppError(
'Token expired',
401,
ERROR_CODES.EXPIRED_TOKEN
);

Rate Limits

const limit = RATE_LIMITS[auth.role.toUpperCase()];
// TENANT_ADMIN: 1000, USER: 100, etc.

License

Proprietary - CleverChain Limited