react_on_rails_pro/LICENSE_SETUP.md
This document explains how to configure your React on Rails Pro license for production use.
React on Rails Pro works without a license for evaluation, development, testing, and CI/CD. No registration or license key is needed to get started.
A paid license is required only for production deployments.
| Environment | License Required? |
|---|---|
| Development | No |
| Test | No |
| CI/CD | No |
| Staging (non-prod) | No |
| Production | Yes (paid) |
If you're upgrading from an earlier version of React on Rails Pro, note these changes:
ReactOnRailsPro::Utils.licensed? has been removed — Use ReactOnRailsPro::LicenseValidator.license_status == :valid insteadReactOnRailsPro::LicenseValidator.license_data has been removed — Only license_status and license_expiration are availableRemove any custom error handling for license exceptions — The license validator no longer raises exceptions
Update license status checks:
# Old (removed)
ReactOnRailsPro::Utils.licensed?
# New
ReactOnRailsPro::LicenseValidator.license_status == :valid
Remove any code that accessed license_data — This method is no longer available
This change allows your application to start even with license issues, giving you time to resolve them without downtime.
Set the REACT_ON_RAILS_PRO_LICENSE environment variable:
export REACT_ON_RAILS_PRO_LICENSE="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
For different environments:
# Production (Heroku)
heroku config:set REACT_ON_RAILS_PRO_LICENSE="your_token"
# Production (Docker)
# Add to docker-compose.yml or Dockerfile ENV
# CI/CD (optional — CI works without a license)
# Add to your CI environment variables if needed
Configure your license token via the REACT_ON_RAILS_PRO_LICENSE environment variable.
Never commit license tokens to version control.
License-related checks and signals occur at multiple points:
railsContext.rorPro (not license-valid state)The browser package does not perform independent license validation. A valid paid license is still required for production deployments.
When no license is present, the application runs in unlicensed mode. This is fine for development, testing, and CI/CD. Production deployments should always have a valid paid license.
No license setup is needed for development. Developers can install and use React on Rails Pro immediately.
For production deployments, configure a paid license via the REACT_ON_RAILS_PRO_LICENSE environment variable.
Migration note:
config/react_on_rails_pro_license.keyis no longer read. If you used that file previously, move the token toREACT_ON_RAILS_PRO_LICENSE.
CI/CD environments work without a license. If your CI pipeline deploys to production, ensure the production environment has a valid paid license configured.
Use the built-in rake task to verify your license status:
# Human-readable output
bundle exec rake react_on_rails_pro:verify_license
# JSON output (for CI/CD and scripting)
FORMAT=json bundle exec rake react_on_rails_pro:verify_license
Example text output:
React on Rails Pro — License Status
========================================
Status: VALID
Organization: Acme Corp
Plan: paid
Expiration: 2025-12-31
Days left: 180
Attribution: not required
Example JSON output:
{
"status": "valid",
"organization": "Acme Corp",
"plan": "paid",
"expiration": "2025-12-31T00:00:00Z",
"attribution_required": false,
"days_remaining": 180,
"renewal_required": false
}
The task exits with code 0 on success and code 1 if the license is missing, invalid, or expired.
| Field | Type | Description |
|---|---|---|
status | string | "valid", "expired", "invalid", or "missing" |
organization | string or null | Organization name from the JWT org claim |
plan | string or null | License plan ("paid", "startup", etc.) |
expiration | string or null | ISO 8601 expiration date |
attribution_required | boolean | Whether attribution is required |
days_remaining | integer or null | Days until expiration (negative if expired) |
renewal_required | boolean | true if expired or expiring within 30 days |
Add this workflow to get notified before your license expires.
Note: This example uses
jqto parse JSON.jqis pre-installed onubuntu-latestrunners. If using a custom runner, addsudo apt-get install -y jqbefore the license check step.
# .github/workflows/license-check.yml
name: License Expiry Check
on:
schedule:
- cron: '0 9 * * 1' # Every Monday at 9 AM UTC
workflow_dispatch: # Allow manual trigger
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Check license status
id: license
env:
REACT_ON_RAILS_PRO_LICENSE: ${{ secrets.REACT_ON_RAILS_PRO_LICENSE }}
RAILS_ENV: production
run: |
result=$(FORMAT=json bundle exec rake react_on_rails_pro:verify_license 2>/dev/null) || true
echo "$result"
status=$(echo "$result" | jq -r '.status')
days=$(echo "$result" | jq -r '.days_remaining')
renewal=$(echo "$result" | jq -r '.renewal_required')
echo "status=$status" >> "$GITHUB_OUTPUT"
echo "days_remaining=$days" >> "$GITHUB_OUTPUT"
echo "renewal_required=$renewal" >> "$GITHUB_OUTPUT"
- name: Create issue if renewal needed
if: steps.license.outputs.renewal_required == 'true'
uses: actions/github-script@v7
with:
script: |
const status = '${{ steps.license.outputs.status }}';
const days = '${{ steps.license.outputs.days_remaining }}';
const title = status === 'expired'
? '🚨 React on Rails Pro license has expired'
: `⚠️ React on Rails Pro license expires in ${days} days`;
const body = [
`**Status:** ${status}`,
`**Days remaining:** ${days}`,
'',
'Renew at https://pro.reactonrails.com/',
'or contact [email protected]',
].join('\n');
// Avoid duplicate issues
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'license',
});
const existing = issues.find(i => i.title.includes('React on Rails Pro license'));
if (!existing) {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title,
body,
labels: ['license'],
});
}
rails console
> ReactOnRails::Utils.react_on_rails_pro?
# Should return: true
window.railsContext.rorPro;
// Should return: true
This is expected behavior in development, test, and CI environments. The application will run in unlicensed mode. For production, ensure the REACT_ON_RAILS_PRO_LICENSE environment variable is set.
Causes:
Solutions:
eyJ)Solutions:
REACT_ON_RAILS_PRO_LICENSE environment variable with the new tokenCause: The license has a plan that is not authorized for production use (e.g., an old free evaluation license).
Solution: Purchase a paid license. Contact [email protected] for pricing.
Cause: You may have an old or malformed license token.
Solution: Contact [email protected] for a new license.
The license is a JWT (JSON Web Token) signed with RSA-256, containing:
{
"sub": "[email protected]", // Your email (REQUIRED)
"iat": 1234567890, // Issued at timestamp (REQUIRED)
"exp": 1234567890, // Expiration timestamp (REQUIRED)
"plan": "paid", // License plan (Optional — only "paid" is valid for production)
"org": "Your Company", // Organization name (Optional)
"iss": "api" // Issuer identifier (Optional, standard JWT claim)
}
Note: The JWT claim is
org. The verify task output uses the field nameorganizationfor readability.
Need help?
Q: Do I need a license for development? A: No. React on Rails Pro works without a license for development, testing, and evaluation.
Q: Do I need a license for CI? A: No. CI/CD environments work without a license. Only production deployments require a paid license.
Q: Do I need internet to validate the license? A: No! License validation is completely offline using cryptographic signatures.