AI workflow
Use Accessly with AI
Copy these prompts into ChatGPT, Claude, Cursor, Codex, Gemini, or a similar coding assistant when you want help integrating Accessly without drifting away from the public API.
What this page is for
Use it to give AI tools a precise Accessly brief before they generate code, refactors, or debugging steps.
When to use it
Use these prompts when starting an integration, adapting a backend response, filtering navigation, or debugging a denied permission.
Important rules for AI
The prompts tell AI tools to use public APIs only, install from npm, keep backend authorization separate, state assumptions, and write TypeScript.
Prompt: Basic Integration
Help me integrate Accessly into a React app. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Create a minimal example that: - defines an AccessModel with permissions and flags - wraps the app in PermissionProvider - uses Can and Cannot for visible and denied UI - uses usePermission for a disabled button - includes a short explanation of where backend authorization still belongs
Prompt: Next.js Client Component Integration
Help me integrate Accessly into a Next.js app using TypeScript client components. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Create a small app-shell example that: - marks Accessly UI files with "use client" when needed - fetches or receives a backend access payload outside Accessly - normalizes it into an AccessModel - passes it to PermissionProvider - uses ProtectedRoute for route-level UI gating - uses Can for page actions - avoids claiming Accessly replaces server-side authorization
Prompt: Backend Adapter
Help me write an Accessly backend adapter for my API response. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. My backend returns this shape: <paste JSON here> Please: - use createAdapter - normalize roles, permissions, flags, and navigation into an AccessModel - keep validation simple and explicit - show the adapter input and output types - include one example PermissionProvider usage
Prompt: RBAC Admin Dashboard
Help me build an RBAC admin dashboard UI with Accessly. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Use these roles and permissions: <paste roles and permissions here> Please: - model the current user's AccessModel - use Can for allowed actions - use Cannot for denied messaging - use useAccessDecision to explain why an admin control is denied - use filterNavigation for sidebar items - keep the result focused on UI gating, not backend enforcement
Prompt: Feature Flags
Help me add feature flag UI checks with Accessly. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Please: - represent enabled features in AccessModel.flags - use Can with a flag check for enabled UI - show a denied/fallback state for a disabled flag - use useAccessDecision to display the missing_flag reason - keep permissions and feature flags conceptually separate
Prompt: Navigation Filtering
Help me filter application navigation with Accessly. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Please: - define typed navigation items with permission fields - define an AccessModel for the current user - use filterNavigation to produce visible navigation - show nested navigation behavior - explain that hidden navigation is only a UX behavior and backend routes still need authorization
Prompt: Debug Denied Permission
Help me debug a denied Accessly permission. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Here is the AccessModel: <paste AccessModel here> Here is the check that is denied: <paste permission, any[], all[], or flag check here> Please: - use useAccessDecision or checkPermission as appropriate - explain allowed, reason, missing, matched, and checkedFrom - identify whether the issue is missing permission, missing flag, loading state, or unknown permission - suggest the smallest safe fix without changing package logic
Prompt: Refactor existing role checks to Accessly
Help me refactor existing React role checks to Accessly. Important rules: - Use only public Accessly APIs. Do not invent APIs. - Install with npm install accessly by default. - Keep backend authorization separate from frontend UI gating. - Use PermissionProvider, Can, Cannot, usePermission, useAccessDecision, createAdapter, and filterNavigation correctly. - Explain assumptions before writing code. - Produce TypeScript code. Here is the existing code: <paste code here> Please: - replace scattered role or permission checks with Accessly APIs - use PermissionProvider for the normalized AccessModel - use Can, Cannot, usePermission, and useAccessDecision where each is most appropriate - use createAdapter if the backend shape is not already an AccessModel - preserve existing behavior unless you identify a real bug - explain every assumption and produce TypeScript code
