Skip to main content

License Key Formats - PhotoFlow SEO Pro

๐Ÿ“‹ Supported Formatsโ€‹

PhotoFlow SEO Pro supports two license key formats:

Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Example: 12345678-1234-1234-1234-123456789ABC

When to use:

  • โœ… Default Lemon Squeezy configuration
  • โœ… No custom prefix setup required
  • โœ… Immediate setup, no configuration needed
  • โœ… Most common for new products

How Lemon Squeezy generates this:

  1. Create product in Lemon Squeezy
  2. Enable "License Keys" toggle
  3. Lemon Squeezy automatically generates UUID-format keys
  4. No additional configuration needed!

2. Custom Prefix Format (Optional)โ€‹

Format: pswp_XXXX_XXXXXXXXXXXX

Examples:

  • Production: pswp_prod_abc123def456
  • Demo: pswp_demo_test1234

When to use:

  • โš ๏ธ Only if you set up custom prefix in Lemon Squeezy
  • โš ๏ธ Requires additional configuration
  • โš ๏ธ Not available in all Lemon Squeezy accounts

How to set up (if available):

  1. Go to Lemon Squeezy โ†’ Product โ†’ License Keys
  2. Look for "Custom Format" or "Prefix" setting
  3. Set prefix to: pswp_prod_
  4. Save changes

Note: This setting may not be available in all Lemon Squeezy accounts. If you can't find it, use the UUID format instead!


๐Ÿ”ง Validation Logicโ€‹

Client-Side (src/pro/license.js)โ€‹

export function isLicenseValidLocally(key) {
if (!key || typeof key !== 'string') return false;

// Accept both formats:
// 1. pswp_* format (custom prefix)
const pswpFormat = /^pswp_[a-z0-9_]{4,}$/i.test(key);

// 2. UUID format (Lemon Squeezy default)
const uuidFormat = /^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$/i.test(key);

return pswpFormat || uuidFormat;
}

Server-Side (server/lemonsqueezy/router.js)โ€‹

// Validates UUID format for Lemon Squeezy API
const uuidRegex = /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;

if (!uuidRegex.test(licenseKey)) {
return res.status(400).json({ error: 'invalid_license_format' });
}

๐Ÿ“ฆ What Customers Seeโ€‹

In Purchase Email:โ€‹

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

(Save this - you'll need it to activate Pro features)

In Code:โ€‹

import { createAiSeoPlugin } from 'photoswipe-pro';

const aiPlugin = createAiSeoPlugin({
licenseKey: '12345678-1234-1234-1234-123456789ABC',
baseUrl: '/api/ai'
});

In Customer Portal:โ€‹

๐Ÿ”‘ License: 12345678-1234-1234-1234-123456789ABC
๐Ÿ“ง Email: customer@example.com
โœ… Status: Active

For New Installations:โ€‹

  1. Use UUID format (Lemon Squeezy default)
  2. No custom prefix configuration needed
  3. Faster setup, less complexity
  4. Fully supported by validation logic

Setup Steps:โ€‹

  1. Create product in Lemon Squeezy
  2. Enable "License Keys" toggle โœ…
  3. Stop here! Lemon Squeezy will use UUID format
  4. Test with a purchase - key will be UUID format
  5. Verify in webhook that license_key is UUID

๐Ÿ”„ Migration Guideโ€‹

If You're Using Custom Prefix:โ€‹

Your existing pswp_prod_* or pswp_demo_* keys will continue to work! The system supports both formats.

If You Want to Switch to UUID:โ€‹

  1. New purchases will use UUID format automatically
  2. Existing keys remain valid
  3. No migration needed - both formats work simultaneously

โœ… Format Validation Examplesโ€‹

Valid Keys:โ€‹

// UUID format (Lemon Squeezy default)
'12345678-1234-1234-1234-123456789ABC' โœ…
'ABCDEF12-3456-7890-ABCD-EF1234567890' โœ…

// Custom prefix format
'pswp_prod_abc123def456' โœ…
'pswp_demo_test1234' โœ…
'pswp_dev_quicktest' โœ…

Invalid Keys:โ€‹

// Too short
'12345' โŒ

// Wrong format
'license-key-12345' โŒ

// Missing parts
'pswp_' โŒ
'prod_abc123' โŒ

// Wrong UUID format
'123-456-789' โŒ

๐Ÿงช Testing License Keysโ€‹

Test UUID Format:โ€‹

# Valid UUID
curl -X POST http://localhost:4001/api/license/validate \
-H 'Content-Type: application/json' \
-d '{"licenseKey":"12345678-1234-1234-1234-123456789ABC"}'

# Response: {"valid":true,"status":"active"}

Test Custom Prefix Format:โ€‹

# Valid pswp_ format
curl -X POST http://localhost:4001/api/license/validate \
-H 'Content-Type: application/json' \
-d '{"licenseKey":"pswp_demo_test1234"}'

# Response: {"valid":true,"status":"active"}

๐Ÿ“Š Format Comparisonโ€‹

FeatureUUID FormatCustom Prefix
Setup Complexityโœ… None neededโš ๏ธ Requires config
Lemon Squeezy Defaultโœ… YesโŒ No
Validation Supportโœ… Fullโœ… Full
Customer Experienceโœ… Simpleโœ… Simple
Recommendedโœ… Yesโš ๏ธ Optional

๐ŸŽฏ Summaryโ€‹

What You Need to Know:โ€‹

  1. UUID format is the default - no configuration needed
  2. Both formats are fully supported - choose what works for you
  3. Use UUID format for simplicity - it's the Lemon Squeezy default
  4. Custom prefix is optional - only if you need branding

Quick Decision:โ€‹

Q: "Which format should I use?"
A: UUID format (Lemon Squeezy default) - it's simpler and requires no setup!

Q: "Will my pswpprod keys still work?"
A: Yes! The system supports both formats simultaneously.

Q: "Can I change formats later?"
A: Yes! Both work at the same time, no migration needed.


โœ… Bottom Line: Use UUID format for the easiest setup experience!