Skip to main content

Prerequisites

  • Node.js environment (for backend) or a modern web browser (for frontend)
  • npm or yarn package manager
  • SunLicense API credentials

Integration steps

1. Backend implementation (Node.js)

2. Frontend implementation (browser)

Never expose your license key in frontend code. Prefer server-side validation.

3. Framework integrations

Best practices

  1. Security
    • Never expose the license key in frontend code
    • Implement server-side validation
    • Use secure communication (HTTPS)
  2. Error handling
    • Implement proper error handling
    • Show user-friendly error messages
    • Log validation failures
  3. Performance
    • Cache validation results
    • Implement retry mechanisms
    • Handle offline scenarios

Common issues and solutions

  1. CORS issues
    • Configure proper CORS headers
    • Use a proxy for API requests
    • Handle preflight requests
  2. Network problems
    • Implement timeout handling
    • Add retry logic
    • Cache validation results