Skip to main content
theauth-go serves plain net/http handlers, so it works with any framework through Handler(). The adapter modules give Gin, Echo and Fiber native middleware, context accessors and a mount helper instead of wrapping the handler yourself. Each adapter is its own Go module, so the framework dependency never enters your root module:

Gin

Echo (theauthecho) and Fiber (theauthfiber) expose the same functions with their own context types:

Shape errors in one place

The adapters write no error bodies. 401 and 403 responses come from theauth and go through Config.ErrorResponder when you set it, so one function shapes errors for every framework:
With the field unset, the bytes are the default application/problem+json bodies, and a test pins that. The responder covers the root middleware and the API token paths. Error responses written inside the account and session route handlers do not go through it yet.

Limits

  • Fiber buffers responses. Server-sent events do not work through the Fiber middleware or Mount. Serve streaming routes outside the adapter.
  • Release ordering. The adapter modules require theauth-go/v2 v2.9.0, which predates ErrorResponder. They build through go.work in the repository until a root release is cut. Pin them to the release that contains ErrorResponder when you add them to your own module.
Last modified on October 13, 2026