@entro314labs/shared-constants
v1.1.1
Published
Shared constants and configuration across the Entrolytics ecosystem
Maintainers
Readme
@entro314labs/shared-constants
Shared constants and configuration across the Entrolytics ecosystem.
Installation
pnpm add @entro314labs/shared-constantsUsage
import {
API_ENDPOINTS,
ENV_VAR_NAMES,
CLI_CONFIG,
getEnvVarNames,
isValidFramework,
} from '@entro314labs/shared-constants'
// Get environment variable names for a framework
const nextjsEnv = getEnvVarNames('nextjs')
console.log(nextjsEnv.websiteId) // 'NEXT_PUBLIC_ENTROLYTICS_WEBSITE_ID'
// Check if a framework is valid
if (isValidFramework('nextjs')) {
// Framework is valid
}
// Access API endpoints
console.log(API_ENDPOINTS.production) // 'https://edge.entrolytics.click'
// CLI configuration
console.log(CLI_CONFIG.tokenExpiryMinutes) // 15Available Constants
API_ENDPOINTS- Production and development API URLsENV_VAR_NAMES- Environment variable naming by frameworkCLI_CONFIG- CLI configuration valuesEVENT_TYPES- Standard event type namesHTTP_STATUS- HTTP status codesAPI_ROUTES- API route pathsONBOARDING_STEPS- Onboarding step identifiersCLI_TOKEN_STATUS- CLI token status valuesUSER_ROLES- User role definitionsFRAMEWORK_PACKAGES- NPM package names by frameworkFRAMEWORK_PATTERNS- Framework detection patternsRATE_LIMITS- Rate limiting configurationERROR_MESSAGES- Standard error messagesSUCCESS_MESSAGES- Standard success messages
Supported Frameworks
- Next.js
- React (Vite/CRA)
- Vue (Vite)
- Svelte/SvelteKit
- Astro
- Node.js (API)
- PHP
- Python
- Go
License
MIT