Skip to main content

License Key Format Update - Summary โœ…

๐ŸŽฏ Issue Identifiedโ€‹

The documentation showed examples using pswp_prod_ prefix format, but Lemon Squeezy generates UUID format by default (like 12345678-1234-1234-1234-123456789ABC).

This created confusion about what format customers would actually receive.


โœ… Solution Implementedโ€‹

1. Validation Logic (Already Correct!)โ€‹

The code already supports both formats:

// From src/pro/license.js
const looksRight =
/^pswp_[a-z0-9_]{4,}$/i.test(key) || // Custom prefix
/^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$/i.test(key); // UUID

Test Results:

  • โœ… UUID format: 12345678-1234-1234-1234-123456789ABC โ†’ VALID
  • โœ… Custom format: pswp_prod_abc123def456 โ†’ VALID
  • โœ… Demo format: pswp_demo_test1234 โ†’ VALID
  • โœ… Short custom: pswp_test โ†’ VALID

2. Documentation Updatedโ€‹

New Comprehensive Guide:โ€‹

  • Created docs/LICENSE-KEY-FORMATS.md
  • Explains both UUID and custom prefix formats
  • Shows validation logic and examples
  • Recommends UUID format for simplicity

Updated Existing Docs:โ€‹

  • docs/LEMON-SQUEEZY-SETUP.md - Shows UUID as default
  • docs/CUSTOMER-JOURNEY.md - Uses UUID in examples
  • docs/AI-MODEL-INTEGRATION.md - Updated examples

3. Demo UI Updatedโ€‹

Before:โ€‹

placeholder="pswp_demo_abcd1234"

After:โ€‹

placeholder="12345678-1234-1234-1234-123456789ABC"

Updated Components:

  • โœ… demo-docs-website/src/components/ProDemo/index.js
  • โœ… demo-docs-website/src/components/CustomerPortal/index.js

๐Ÿ“Š Supported Formatsโ€‹

Format:  XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Example: 12345678-1234-1234-1234-123456789ABC

Setup: None required! Lemon Squeezy generates this automatically.

Format 2: Custom Prefix (Optional)โ€‹

Format:  pswp_XXXX_XXXXXXXXXXXX
Example: pswp_prod_abc123def456

Setup: Configure custom prefix in Lemon Squeezy (if available)

๐Ÿ”ง What Changedโ€‹

Code Changes:โ€‹

  • โŒ No code changes needed! Validation already supported both formats

Documentation Changes:โ€‹

  1. โœ… Created comprehensive format guide
  2. โœ… Updated setup instructions to clarify UUID is default
  3. โœ… Updated all examples to show UUID format first
  4. โœ… Clarified custom prefix is optional

UI Changes:โ€‹

  1. โœ… Updated demo placeholders to show UUID format
  2. โœ… Updated help text to mention both formats
  3. โœ… Increased input width for longer UUID keys

๐ŸŽฏ Customer Impactโ€‹

What Customers Will See:โ€‹

In Purchase Email:

YOUR LICENSE KEY:
12345678-1234-1234-1234-123456789ABC

In Demo:

License Key: [12345678-1234-1234-1234-123456789ABC]
โ†‘ UUID format (default)

Both Formats Work:

  • Customers with UUID keys: โœ… Works
  • Customers with pswp_ keys: โœ… Works
  • No migration needed!

๐Ÿ“‹ Setup Recommendationโ€‹

For New Users:โ€‹

  1. Create product in Lemon Squeezy
  2. Enable "License Keys" toggle
  3. Stop! Use UUID format (default)
  4. Test purchase โ†’ receive UUID key
  5. Key works immediately in Pro package

No custom prefix configuration needed! ๐ŸŽ‰


๐Ÿงช Validation Testingโ€‹

# Test UUID format
curl -X POST http://localhost:4001/api/license/validate \
-H 'Content-Type: application/json' \
-d '{"licenseKey":"12345678-1234-1234-1234-123456789ABC"}'
# โœ… Response: {"valid":true}

# Test custom format
curl -X POST http://localhost:4001/api/license/validate \
-H 'Content-Type: application/json' \
-d '{"licenseKey":"pswp_demo_test1234"}'
# โœ… Response: {"valid":true}

โœ… Summaryโ€‹

Problem: Documentation showed pswp_prod_ format, but Lemon Squeezy uses UUID by default.

Solution:

  1. โœ… Clarified UUID is the default format
  2. โœ… Updated all examples to show UUID first
  3. โœ… Documented both formats are supported
  4. โœ… No code changes needed - validation already works!

Result: Clear, accurate documentation that matches what customers actually receive from Lemon Squeezy.

Recommendation: Use UUID format (Lemon Squeezy default) for easiest setup! ๐Ÿš€