Skip to content

Feature Request: First-class proxy.ts support following Next.js 16+ conventions #364

@BunsDev

Description

@BunsDev

Feature Request: First-class proxy.ts support following Next.js 16+ conventions

Summary

Next.js 16+ has deprecated middleware.ts in favor of proxy.ts as the standard file convention for server-side request handling. While the current library documentation mentions this change, the API still centers around authkitMiddleware naming, which could be confusing for developers adopting the new conventions.

Current State

The library exports authkitMiddleware() and requires renaming files manually:

// From README: "The code remains the same; only the filename and export name differ"
import { authkitMiddleware } from '@workos-inc/authkit-nextjs';
export default authkitMiddleware();

Suggested Improvements

  1. Add authkitProxy export as an alias or replacement for authkitMiddleware to align with Next.js 16+ naming
  2. Update composable function names - the authkit() helper is good, but handleAuthkitHeaders() could have a proxy-equivalent name
  3. Consider deprecation warnings when using authkitMiddleware on Next.js 16+

Example of desired API

// proxy.ts (Next.js 16+)
import { authkitProxy } from '@workos-inc/authkit-nextjs';
export default authkitProxy();

References

Environment

  • @workos-inc/authkit-nextjs: latest
  • Next.js: 16+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions