Skip to content

Fix nextjs quickstart middleware pattern to use asgardeoMiddleware#456

Open
udanfernando2006 wants to merge 3 commits into
asgardeo:mainfrom
udanfernando2006:udanfernando2006/docs/fix-nextjs-quickstart-middleware
Open

Fix nextjs quickstart middleware pattern to use asgardeoMiddleware#456
udanfernando2006 wants to merge 3 commits into
asgardeo:mainfrom
udanfernando2006:udanfernando2006/docs/fix-nextjs-quickstart-middleware

Conversation

@udanfernando2006
Copy link
Copy Markdown

@udanfernando2006 udanfernando2006 commented Apr 15, 2026

Purpose

The QUICKSTART.md was using outdated API patterns (new AsgardeoNext() with .middleware() method) that don't match the current SDK implementation. This could confuse developers following the guide, as the code wouldn't work.

Updated to use the correct asgardeoMiddleware function exported from @asgardeo/nextjs/server, which aligns with the official Asgardeo documentation.

Related Issues

  • Addresses inconsistency between documented and actual SDK API.

Related PRs

  • N/A

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Documentation provided.
  • No unit tests needed (documentation-only).

Security checks

  • N/A (documentation-only change).

Summary by CodeRabbit

  • Documentation
    • Simplified Next.js quickstart middleware instructions and revised embedded sign-in example; noted Next.js 16 middleware/proxy filename change.
    • Removed React quickstart guide and Vue quickstart guide content.
    • Updated Vue README to link to the local quickstart document.

Review Change Stack

@pavinduLakshan
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db3ea042-2ed7-45e4-bcf1-a539e6a3ee5f

📥 Commits

Reviewing files that changed from the base of the PR and between 8f4e7a7 and ae9b05e.

📒 Files selected for processing (4)
  • packages/nextjs/QUICKSTART.md
  • packages/react/QUICKSTART.md
  • packages/vue/QUICKSTART.md
  • packages/vue/README.md
💤 Files with no reviewable changes (3)
  • packages/vue/QUICKSTART.md
  • packages/react/QUICKSTART.md
  • packages/nextjs/QUICKSTART.md

📝 Walkthrough

Walkthrough

Update Next.js Quickstart examples to use export default asgardeoMiddleware() (with optional signInUrl option) and note Next.js 16 middleware.tsproxy.ts rename; remove React and Vue quickstart files and adjust the Vue README quick-start link.

Changes

Quickstart Documentation

Layer / File(s) Summary
Next.js middleware example
packages/nextjs/QUICKSTART.md
Replace manual AsgardeoNext instantiation and export async function middleware(request: NextRequest) wrapper with export default asgardeoMiddleware(); move signInUrl into asgardeoMiddleware options and add Next.js 16 rename note.
React quickstart removal
packages/react/QUICKSTART.md
Remove the entire React quickstart guide content.
Vue quickstart removal
packages/vue/QUICKSTART.md
Remove the entire Vue quickstart guide content.
Vue README link
packages/vue/README.md
Update Quick Start link to reference the local ./QUICKSTART.md path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through docs with nimble feet,
Swapped boilerplate for one neat feat,
Exports aligned, links set right,
Quickstarts pruned and shining bright—🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix nextjs quickstart middleware pattern to use asgardeoMiddleware' accurately reflects the primary change in the PR: updating the Next.js quickstart to use the correct asgardeoMiddleware function instead of the outdated API pattern.
Description check ✅ Passed The description addresses most template sections: it provides a clear purpose explaining the issue and solution, mentions related issues, includes the checklist with appropriate selections, and notes security checks as N/A for documentation-only changes. However, it lacks the checklist item for 'Unit tests provided', making it incomplete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/nextjs/QUICKSTART.md`:
- Around line 214-219: The documentation example passes the configuration object
as the first argument to asgardeoMiddleware, but the function signature expects
an optional handler as the first parameter and options as the second; update the
example so the options object (containing signInUrl) is provided as the second
argument to asgardeoMiddleware, e.g. call asgardeoMiddleware with undefined for
the handler when you only need options, or pass your handler function first and
the options object second (references: asgardeoMiddleware, handler, options,
signInUrl).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d9805a2-85aa-4976-b4b3-d7219e04cf86

📥 Commits

Reviewing files that changed from the base of the PR and between ae01ffe and eb0c64e.

📒 Files selected for processing (1)
  • packages/nextjs/QUICKSTART.md

Comment thread packages/nextjs/QUICKSTART.md Outdated
@brionmario
Copy link
Copy Markdown
Member

Ideally we should not have these QUICKSTART.md files maintained here since we already have the Quickstart on the docs linked in the README.

@udanfernando2006 Can you please check if the Documentation is up to date: https://wso2.com/asgardeo/docs/quick-starts/nextjs/

And please update the PR to remove all the following files.

Screenshot 2026-05-11 at 14 47 28

@udanfernando2006
Copy link
Copy Markdown
Author

Thanks for the update. The official docs at https://wso2.com/asgardeo/docs/quick-starts/nextjs/ are already up to date, as it has separate tabs for "Next.js 16 and later" (proxy.ts) and "Next.js 15 and earlier" (middleware.ts). I'll update the PR to remove all three QUICKSTART.md files.

@udanfernando2006
Copy link
Copy Markdown
Author

Updated. Removed all three QUICKSTART.md files. I also updated the README.md file for Vue which referenced the now deleted QUICKSTART.md file to instead point to https://wso2.com/asgardeo/docs/quick-starts/vue/. Happy to make any further changes if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants