Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nudj.cx/llms.txt

Use this file to discover all available pages before exploring further.

🔴 Release v2.315.0

⭐⭐⭐ Complex • 26 commits • 778 files changed
Massive feature release adding comprehensive plan management, AI-powered asset generation, automatic data reconciliation, OAuth 2.1 support for Claude.ai integrations, and post-purchase referral campaigns. Includes enterprise entitlements system with feature gating, Shopify post-purchase theme extension, tiered loyalty system, and significant API performance improvements.

What’s New

  • Subscription Plans Management – Dedicated plans page for managing organization tier, feature limits, and entitlements with real-time usage tracking
  • Community Asset Library with AI Generation – Centralized image management with automatic AI variant generation, bulk upload, and usage tracking across all communities
  • Entitlements System – Enterprise-grade subscription plan validation gating AI generation, community creation, and custom features per plan tier
  • Post-Purchase Referral Campaigns – Shopify theme extension block for capturing referrals at checkout with automatic reward distribution
  • Automatic Data Reconciliation – Background cron job that fixes drift in challenge schedules, reward giveaways, and achievement data with comprehensive reconciliation framework
  • OAuth 2.1 Support – Enable Claude.ai custom connectors with standards-compliant OAuth flows and token management in Developer Settings
  • Tiered Loyalty System – Unlock advanced loyalty tier configurations with new MCP tools for demo generation and tier management
  • API Performance Optimization – 60%+ faster list endpoints by parallelizing database calls across challenges, achievements, posts, and rewards

Apps Updated

User App

✓ Updated - 5 changes

API

✓ Updated - 12 changes

Admin

✓ Updated - 8 changes

MCP Server

✓ Updated - 3 changes

Games

— No changes

Detailed Changes

New Features:
  • Plans page under Organization Settings for viewing and managing subscription tier, available features, and current usage limits
  • Paywall modal system for enforcing feature limits (AI image generation, community creation) with upgrade prompts
  • Connected Apps section in Developer Settings for managing active OAuth integrations and revoking access
  • Asset detail drawer with bulk action support and usage tracking across all communities
  • Asset grid with density toggle and refine dialog for generating AI image variants
  • Improved community profile layout and UX for better visual hierarchy and information architecture
Fixes:
  • Fixed sign-out crash caused by getSetCookie() errors on raw NextAuth responses
  • Fixed legal settings form input being wiped during validation
Performance:
  • Parallelize database queries for improved list page responsiveness
New Features:
  • Entitlements system tracking organization subscription plans and feature access
  • OAuth 2.1 support for Claude.ai custom connector flows with assertion JWT generation
  • Plan subscription mutation API for managing organization tier changes
  • Entitlement checking endpoints for validating feature access before operations
  • Schedule reconciliation cron endpoint for fixing data drift across challenges, rewards, achievements, and posts
  • Asset usage tracking API showing which communities use each asset
  • Asset AI metadata storage for tracking generation provider, prompt, and variant relationships
  • Discard unused variants mutation for cleaning up generated asset variants
  • Refine asset batch mutation for generating new AI variants with updated prompts
Fixes:
  • Fixed MCP games.create to default isStandalone to true
  • Fixed preserve isAnonymous flag when /api/link re-uses anonymous email
  • Parallelize database calls in challenges, achievements, posts, and rewards list endpoints (60%+ performance improvement)
  • Consolidate game session lookups and eliminate redundant count query
Infrastructure:
  • Schedule reconciliation cron service with multiple reconciler types (entity start/end, reward giveaway)
  • Extended reconciliation to Achievement, Post, Reward, and LeaderboardConfig entities
  • Added Vercel cron configuration for automatic schedule reconciliation
Fixes:
  • Removed redundant post hero stat labels for cleaner post display
  • Fixed post back navigation fallback route to prevent navigation errors
  • Fixed anonymous user email re-use when linking accounts via /api/link
New Features:
  • Tiered loyalty system support with new MCP tools for managing loyalty tiers
  • Enhanced demo generation v2 with improved challenge, reward, and allocation templates
  • OAuth 2.1 support for Claude.ai custom connector integration
  • Connected apps listing and token management
Fixes:
  • Default games.create isStandalone to true for better standalone game behavior
Migrations:
  • Backfill organization subscription data with plan defaults
  • Add community entitlement count index for efficient plan validation queries
  • Add challenges status/startsAt index for schedule reconciliation efficiency
  • Extend achievement, post, reward, and leaderboard config with reconciliation metadata
New Collections:
  • organisationSubscription for tracking plan tier and feature limits per organization
  • oauth* (oauth-token, oauth-client, oauth-device-flow) for OAuth 2.1 token and client management
New Features:
  • Post-purchase referral nudge theme extension block for capturing referrals at checkout
  • Automatic referral reward distribution with integration to Nudj loyalty system
  • Schema-validated referral block with 6-header configuration limit
  • Referral nudge data handler for identifying active promotions and reward logic
Fixes:
  • Drop info key from referral-nudge block schema for cleaner structure
  • Unnest schema tag in referral-nudge block to match theme extension conventions

Key Features Explained

Subscription Plans Management

Organizations can now view and manage their Nudj subscription plan through a dedicated Plans page in Organization Settings. The page displays:
  • Current plan tier and expiration date
  • Feature limits (AI image generation quota, community limit per plan)
  • Real-time usage tracking (communities created, AI images generated)
  • Upgrade buttons for increasing plan tier when limits are hit
Feature limits are enforced via paywall modals throughout the admin interface. When a user hits a limit (e.g., community creation limit), they see a friendly upgrade prompt with a direct link to the Plans page.

Community Asset Library with AI Generation

Admins can now manage images centrally through a dedicated Asset Library accessible from Community Settings. Features include:
  • Drag-and-drop bulk upload for multiple images at once
  • Automatic AI image variant generation powered by FAL.ai Flux Pro
  • Refine dialog for regenerating variants with custom prompts
  • Asset detail drawer showing usage across all communities
  • Discard unused variants to clean up generated assets
  • Real-time usage tracking (which challenges/rewards use which assets)
The AI generation system is plan-gated — users on limited plans see a paywall modal. Generated variants include comprehensive metadata (provider, original prompt, generation timestamp).

Automatic Data Reconciliation

Nudj now runs automatic reconciliation cron jobs that detect and fix data drift across your gamification entities:
  • Challenge Schedules – Fixes challenges that should have started/ended but didn’t (missing status transitions)
  • Reward Giveaways – Fixes scheduled reward giveaways with drifted times
  • Achievement/Post/Reward/LeaderboardConfig – Extends reconciliation framework to all major entities
  • Transparent Operation – Drift fixes are logged for audit trail
The reconciliation system includes extensible reconciler types (EntityStart, EntityEnd, RewardGiveaway) that can detect and fix specific drift patterns. This runs automatically on Vercel’s cron scheduler — no manual intervention needed.

OAuth 2.1 Support for Claude.ai

Admin panel now supports OAuth 2.1 custom connector flows for integrating with Claude.ai and other OAuth clients:
  • Standards-compliant OAuth 2.1 assertion JWT generation
  • Consent page in /oauth/consent with user approval workflow
  • Connected Apps listing in Developer Settings showing active integrations
  • Token revocation support for disconnecting apps
  • Automatic state validation and same-origin checks for security
Useful for: integrating Nudj with Claude.ai, building custom AI assistant workflows that manage your gamification platform.

Post-Purchase Referral Campaigns

New Shopify post-purchase theme extension block captures referrals at checkout:
  • Displays referral offer after order confirmation
  • Automatic referral reward distribution to both referrer and referee
  • Integrates with Nudj’s referral conditions (if configured in Community Settings)
  • Customizable messaging and reward copy
  • No code required — fully configurable via Shopify theme editor
This is a powerful channel for driving referrals during the moment of purchase confirmation.

Tiered Loyalty System

The MCP (Model Context Protocol) now includes advanced loyalty tier tools:
  • create_loyalty_tier, update_loyalty_tier, list_loyalty_tiers for tier management
  • Tier-specific point multipliers and exclusive perks
  • Integration with demo-gen v2 for rapid tier setup during onboarding
  • Enhanced Shopify agent prompts with loyalty tier best practices
New agents can now generate sophisticated multi-tier loyalty programs in seconds.

API Performance Improvements

60%+ faster list endpoints across the platform:
  • Challenges list – Parallel database queries for concurrent data fetching
  • Achievements list – Consolidated lookups and batch operations
  • Posts/Rewards list – Parallel community enrichment lookups
  • Game sessions – Eliminated redundant count queries
Changes are transparent — no API contract changes, just faster responses.

Admin Highlights

  • Plans Page – View your subscription tier, current usage, and feature limits in one place; upgrade instantly when you hit limits
  • AI Asset Generation – Generate unlimited image variants from a single prompt; bulk upload images and reuse across challenges and rewards
  • Feature Gating with Paywalls – Beautiful upgrade prompts when hitting plan limits, with direct links to upgrade
  • Asset Usage Tracking – See exactly which communities use which assets; find and delete unused variants
  • Automatic Data Healing – Background reconciliation jobs fix drift in challenge schedules and reward timing; no manual fixes needed
  • OAuth Management – Connect with Claude.ai and other OAuth clients; manage active tokens in Developer Settings
  • Connected Apps – View and revoke access to any third-party integration with one click
  • Referral Analytics – Post-purchase referral campaigns now appear in Shopify post-purchase flow with automatic reward distribution
  • Community Profile UX – Improved layout for better information hierarchy and visual organization

User Highlights

  • Anonymous User Account Linking – Seamless account linking for users who started anonymously; email preserved when converting to full account
  • Cleaner Post Display – Removed redundant stat labels from post heroes for better visual clarity
  • Improved Navigation – Fixed fallback routes for back navigation to prevent errors when returning from posts

Breaking Changes

None. All changes are backward compatible.

Performance Impact

This release delivers significant performance improvements:
EndpointBeforeAfterImprovement
List Challenges800ms350ms56% faster
List Achievements650ms280ms57% faster
List Posts520ms210ms60% faster
List Rewards680ms290ms57% faster
Benefits realized by parallelizing database queries — critical for orgs with thousands of gamification entities.

Technical Notes

Reconciliation Framework

The schedule reconciliation system uses an extensible reconciler pattern:
interface Reconciler {
  name: string;
  reconcile(org: Organisation): Promise<ReconciliationResult>;
}
Reconcilers are registered and run sequentially by the cron service. Each reconciler:
  1. Finds entities with drift (e.g., challenges that should have started)
  2. Applies fixes (status transitions, timestamp corrections)
  3. Returns audit log entries for transparency
Current reconcilers: EntityStartReconciler, EntityEndReconciler, RewardGiveawayReconciler. Extensible for new entity types.

Entitlements System

Feature access is controlled via the EntitlementsService:
getEntitlement(orgId, key: EntitlementKey) 
  → { current, limit, planId }
Features gated:
  • ai.image_generation (Boolean entitlement — either available or not)
  • communities.per_org (Numeric entitlement — quota per plan)
Paywall modals use the useEntitlement hook to check access before operations.

OAuth 2.1 Flow

Custom connector flows follow the standard OAuth 2.1 assertion JWT pattern:
  1. MCP server redirects user to /oauth/consent?mcp_state=<jwt>
  2. Admin verifies mcp_state JWT, renders consent form
  3. User approves, admin signs assertion JWT
  4. Admin redirects to MCP_OAUTH_CALLBACK_URL with assertion
  5. Assertion is exchanged for access token by the OAuth client

Database Migrations

  • 2024-04-29-backfill_organisation_subscription.ts – Inserts default subscription records for all orgs
  • 2024-04-23-add_community_entitlement_count_index.ts – Speeds up plan validation queries
  • 2024-04-29-add_challenges_status_startsAt_index.ts – Speeds up schedule reconciliation queries
  • Custom Domains (white-labeling)
  • Email Notifications (transactional emails)
  • Feature Flags (PostHog integration)
  • Webhook Events (third-party integrations)
  • Data Hydration (customer data platform)

Contributors

Derek Counihan@erek_d@me.com12 commits • +58,695/-13,646 lines

James Cockayne@jamescockayne9 commits • +18,653/-451 lines

Jen@jestella081 commit • +7,817/-1,619 lines

Saad@SaadK943 commits • +47/-88 lines

Release Stats

MetricValue
Total Commits26
Lines Added+83,910
Lines Removed-14,357
Files Changed778
Release SizeMassive 🔴
Complexity⭐⭐⭐

v2.315.0 deployed on April 30, 2026