License Key Formats - PhotoFlow SEO Pro
๐ Supported Formatsโ
PhotoFlow SEO Pro supports two license key formats:
1. UUID Format (Lemon Squeezy Default) โ Recommendedโ
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:
- Create product in Lemon Squeezy
- Enable "License Keys" toggle
- Lemon Squeezy automatically generates UUID-format keys
- 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):
- Go to Lemon Squeezy โ Product โ License Keys
- Look for "Custom Format" or "Prefix" setting
- Set prefix to:
pswp_prod_ - 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
๐ฏ Recommended Setupโ
For New Installations:โ
- Use UUID format (Lemon Squeezy default)
- No custom prefix configuration needed
- Faster setup, less complexity
- Fully supported by validation logic
Setup Steps:โ
- Create product in Lemon Squeezy
- Enable "License Keys" toggle โ
- Stop here! Lemon Squeezy will use UUID format
- Test with a purchase - key will be UUID format
- Verify in webhook that
license_keyis 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:โ
- New purchases will use UUID format automatically
- Existing keys remain valid
- 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โ
| Feature | UUID Format | Custom 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:โ
- UUID format is the default - no configuration needed
- Both formats are fully supported - choose what works for you
- Use UUID format for simplicity - it's the Lemon Squeezy default
- 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!