Server-side entry point for the IGRP Framework — root and route-group layouts, the config builder, and the access-management API client.
- Node.js ≥ 20.x
- Next.js ^15.5.15
- React ^19.2.5 + react-dom ^19.2.5
pnpm add @igrp/framework-next| Export | Entry | Purpose |
|---|---|---|
IGRPRootLayout |
. |
Root-level server layout. Wraps <html> with theme + global providers. |
IGRPLayout |
. |
Route-group server layout. Renders header + sidebar chrome around protected routes. |
IGRPGlobalLoading |
. |
Full-page loading indicator for loading.tsx files. |
| Export | Entry | Purpose |
|---|---|---|
igrpBuildConfig |
. |
Assembles the full IGRP config: layout, API client, toaster, session. Honors IGRP_PREVIEW_MODE. |
| Export | Entry | Purpose |
|---|---|---|
igrpGetAccessClient |
. |
Returns a pre-configured typed API client for the IGRP Access Management service. |
igrpGetAccessClientConfig |
. |
Returns the raw config object used to construct the client. |
igrpBuildQueryString |
. |
Type-safe query-string builder for access-management requests. |
| Export | Entry | Purpose |
|---|---|---|
igrpDeleteAuthCookies |
. |
Clears NextAuth session cookies on logout. |
| Export | Entry | Purpose |
|---|---|---|
IGRPError, IGRPAuthError, IGRPNotFoundError, … |
./errors |
Typed error hierarchy for App Router error boundaries. |
// src/app/layout.tsx
import { IGRPRootLayout } from '@igrp/framework-next';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return <IGRPRootLayout>{children}</IGRPRootLayout>;
}// src/app/(igrp)/layout.tsx
import { IGRPLayout } from '@igrp/framework-next';
import { getConfig } from '@/igrp.template.config';
export default async function Layout({ children }: { children: React.ReactNode }) {
const config = await getConfig();
return <IGRPLayout config={config}>{children}</IGRPLayout>;
}// src/igrp.template.config.ts
import { igrpBuildConfig } from '@igrp/framework-next';
import { cache } from 'react';
export const getConfig = cache(async () => {
return igrpBuildConfig({
appCode: process.env.IGRP_APP_CODE!,
previewMode: process.env.IGRP_PREVIEW_MODE === 'true',
// layoutMockData, apiManagementConfig, toasterConfig, sessionArgs ...
});
});When previewMode is true, igrpBuildConfig swaps in mock layout data and disables session refetch — no auth or API backend needed.
// src/app/(igrp)/error.tsx
import { IGRPAuthError } from '@igrp/framework-next/errors';
export function onError(error: unknown) {
if (error instanceof IGRPAuthError) {
// redirect to login
}
}Set IGRP_PREVIEW_MODE=true to run the template without authentication or an API backend. Mock data replaces live API calls; no redirects to /login.
See IGRP_PREVIEW_MODE docs in the monorepo.
# From repo root
pnpm build:next
# From package directory
pnpm buildBuilt with SWC + Babel (React Compiler pass). Escape hatch: pnpm build:without_reactcompiler.
This is the top of the dependency chain — it depends on all other framework packages but no other framework package depends on it:
framework-next-auth → framework-next-types → design-system → framework-next-ui → framework-next
Changes here affect only templates and apps, not other framework packages.
MIT © IGRP Labs