Skip to content

Next.js integration #655

@yamcodes

Description

@yamcodes

This issue tracks a potential Next.js integration for ArkEnv, following a similar philosophy to the Vite and Bun plugins.

Related discussion: #611 (contains useful insights by @shadyar-bakr)

Goals

  • Provide first-class Next.js integration without coupling ArkEnv core to Next.js
  • Prevent server-only env access from client components
  • Maintain typesafety and validation guarantees

Non-goals

  • Adding client/server separation logic to the core library
  • Replacing Next.js error handling or env conventions

Open questions

  • withArkEnv(nextConfig) vs standalone helper
  • How to handle app router vs pages router
  • Build-time vs runtime enforcement boundaries
  • Is it considered a "plugin"? (Not sure Next.js even has a plugin system)
  • What should we call it? @arkenv/nextjs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededrfcA proposal open for discussion, inviting feedback before writing code. May or may not land as-is

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions