Implementation of the Hosted Login Integration (React). And Entitlements Integration (React).
- Open
index.js
, add your Client ID and API Key fromFrontegg Portal ➜ [ENVIRONMENT] ➜ Env Settings page
:
const contextOptions = {
baseUrl: 'https://[YOUR_SUBDOMAIN].frontegg.com',
clientId: '[YOUR-CLIENT-ID]'
};
- Open
App.js
, replace"test"
with the Feature name you set in the Frontegg Portal:
const { isEntitled: isFEntitled, justification: fJust } =
useFeatureEntitlements("test");
const { isEntitled: isPEntitled, justification: pJust } =
usePermissionEntitlements("test");
const { isEntitled: isPEntitled2, justification: pJust2 } = useEntitlements({
permissionKey: "test",
});
const { isEntitled: isFEntitled2, justification: fJust2 } = useEntitlements({
featureKey: "test",
});
- Run
npm install
and thennpm start
- Open your browser and navigate to
http://localhost:3000