LumnGate

Feature gate component. Renders children only when the customer has access; shows fallback otherwise. Supports usage display.

typescript
import { LumnProvider, LumnGate } from '@lumnsh/react';
function App() {
return (
<LumnProvider apiKey={process.env.NEXT_PUBLIC_LUMN_API_KEY} baseUrl={process.env.NEXT_PUBLIC_LUMN_API_BASE_URL}>
<LumnGate
feature="pro_dashboard"
customerId="user_123"
fallback={(state) => <UpgradePrompt state={state} />}
renderUsage={({ used, remaining, reset_at }) => (
<p>{used} / {used + remaining} used, resets {reset_at}</p>
)}
>
<ProDashboard />
</LumnGate>
</LumnProvider>
);
}

LumnGateProps

Parameter reference
ParameterTypeRequiredDescriptionExample
featurestringRequiredThe unique key of the feature to check.'pro_dashboard'
customerIdstringRequiredRequired ID for customer-specific gating.'user_123'
fallback(state: FallbackState) => ReactNodeOptionalCustom render function when access is denied.-
renderUsage(data: LumnGateUsageData) => ReactNodeOptionalCallback to display usage data (used, remaining, reset_at).-
childrenReactNodeRequiredContent to render ONLY when the customer IS entitled.-

Interactive UI & Output

Paste your API key above to try

Parameters