UNPKG

@astermind/astermind-pro

Version:

Astermind Pro - Premium ML Toolkit with Advanced RAG, Reranking, Summarization, and Information Flow Analysis

178 lines (126 loc) 5.09 kB
# License Setup Guide Astermind Pro uses a centralized license configuration system that automatically propagates your license to both Astermind Pro and Astermind Synth (included with your Pro subscription). ## Quick Start ### Option 1: Configuration File (Recommended) Edit `src/config/license-config.ts`: ```typescript export const LICENSE_TOKEN: string | null = 'YOUR_LICENSE_TOKEN_HERE'; ``` The license will be automatically initialized when you import from `@astermind/astermind-pro`. ### Option 2: Environment Variable Set the `ASTERMIND_LICENSE_TOKEN` environment variable: ```bash # Linux/Mac export ASTERMIND_LICENSE_TOKEN="your-license-token-here" # Windows set ASTERMIND_LICENSE_TOKEN=your-license-token-here # Or in .env file ASTERMIND_LICENSE_TOKEN=your-license-token-here ``` ### Option 3: Programmatic Setup ```typescript import { initializeLicense, setLicenseTokenFromString } from '@astermind/astermind-pro'; // Initialize the license system initializeLicense(); // Set your license token await setLicenseTokenFromString('your-license-token-here'); ``` ## How It Works 1. **Single Configuration Point**: Set your license once in `src/config/license-config.ts` 2. **Automatic Propagation**: The license automatically propagates to: - Astermind Pro (primary) - Astermind Synth (included with Pro subscription) 3. **Environment Fallback**: If no token is set in config, it checks the `ASTERMIND_LICENSE_TOKEN` environment variable 4. **Early Initialization**: License is initialized automatically when you import from `@astermind/astermind-pro` ## License Functions ### Check License Status ```typescript import { checkLicense, getLicenseStatus } from '@astermind/astermind-pro'; // Quick check if (checkLicense()) { // License is valid } // Detailed status const status = getLicenseStatus(); console.log(status.status); // 'valid' | 'invalid' | 'expired' | 'missing' console.log(status.payload); // License payload with features, expiration, etc. ``` ### Require License (Throws if Invalid) ```typescript import { requireLicense } from '@astermind/astermind-pro'; // This will throw if license is invalid requireLicense(); // Now safe to use premium features ``` ### Check Synth License ```typescript import { checkSynthLicense } from '@astermind/astermind-pro'; if (checkSynthLicense()) { // Astermind Synth is available import { loadPretrained } from '@astermind/astermind-synthetic-data'; // Use Synth features } ``` ## Getting Your License Token 1. Visit https://license.astermind.ai 2. Log in to your account 3. Navigate to your license keys 4. Copy your Astermind Pro license token 5. Set it in `src/config/license-config.ts` or via environment variable ## License Features Your Astermind Pro license includes: - ✅ All Astermind Pro premium features - ✅ Astermind Synth (synthetic data generation) - ✅ Production and development usage - ✅ All advanced features (RAG, reranking, summarization, transfer entropy, etc.) ## Troubleshooting ### License Not Working 1. **Check token format**: Should be a JWT token string 2. **Check expiration**: License may have expired 3. **Check environment**: Ensure environment variable is set correctly 4. **Check initialization**: Call `initializeLicense()` before using features ### Synth Not Available If Astermind Synth features aren't available: 1. Ensure `@astermind/astermind-synthetic-data` is installed 2. Check that your Pro license includes Synth (it should by default) 3. Verify license propagation: `checkSynthLicense()` should return `true` ### Development vs Production - **Development**: License is still required (strict mode) - **Production**: License is required (strict mode) - **Testing**: Use a test/dev license key or mock the license runtime ## Example: Complete Setup ```typescript // 1. Set license in src/config/license-config.ts export const LICENSE_TOKEN: string | null = 'your-token-here'; // 2. In your application code import { initializeLicense, checkLicense, rerankAndFilter, summarizeDeterministic } from '@astermind/astermind-pro'; import { loadPretrained } from '@astermind/astermind-synthetic-data'; // Initialize (usually done automatically, but you can do it explicitly) initializeLicense(); // Check license before using features if (checkLicense()) { // Use Pro features const results = rerankAndFilter(query, documents, options); const summary = summarizeDeterministic(query, results, options); // Use Synth features (license automatically propagated) const synth = loadPretrained('hybrid'); // ... use synth } else { console.error('License is not valid'); } ``` ## Security Notes - **Never commit license tokens to version control** - Use environment variables or secure config management in production - License tokens are JWTs and should be kept secure - The license system validates tokens server-side via JWT verification ## Support For license issues: - Email: support@astermind.ai - License Portal: https://license.astermind.ai - Documentation: See [DEVELOPER_GUIDE.md](./DEVELOPER_GUIDE.md)