Deployment
Production checklist for a Go service that embeds Signet.
Signet is a library inside your service — there is no separate auth process to deploy. This page covers the settings that matter in production.
Checklist
- Serve HTTPS. Cookies are
Secureby default. Behind a TLS-terminating proxy, make sure the application still sees the original scheme so redirects and links are correct. - Start from
DefaultConfig(). It setsSecureandHttpOnlycookies. A zeroConfig{}fails withErrInsecureConfig; never enableInsecureAllowHTTPCookiesorInsecureDisableCSRFin production. - Set a random 32-byte
CSRFKeyand a 32-byteOAuth.StateKeywhen OAuth is enabled. Generate them once and store them in your secret manager; rotating them invalidates outstanding CSRF tokens or OAuth state. - Set
AppURLto the public origin so verification and reset links point to your frontend. Serve/verifyand/resetpages that extract the token and call the API. - Configure a real Mailer. Use
mailer/smtpwith STARTTLS or implicit TLS; the console mailer is development only. - Connect and migrate your Store. Call
Migrate(ctx)from a deployment step or at startup, and own the schema as described in Storage. - Mount
Client.Handler()underPathPrefix. The handler serves the prefixed paths itself, so do not wrap it inhttp.StripPrefix. Protect private routes withRequireAuth. - Use a durable RateLimiter. The interface is a boolean gate; your implementation
decides the window, counter store and key policy. The key format is
endpoint+"|"+clientIP.
Cookies behind a prefix
The session cookie is named signet_session, prefixed with __Host- when Secure is true,
Path is / and Domain is empty. Browsers only accept __Host- cookies over HTTPS with
no Domain and a secure origin. If your setup needs a cross-subdomain cookie, set Domain
explicitly — the prefix is then omitted.
Trusted proxies are configured as CIDR ranges in Config.TrustedProxies. With none
configured, X-Forwarded-For is ignored and the connection address is the rate-limit key.
When the immediate peer is trusted, the chain is walked right-to-left to the first
untrusted hop; IPv6 addresses are normalized. Never trust a proxy you do not control.
JWT-only services
For API-only deployments set JWTOnly: no session cookies or CSRF key are needed, and
clients use POST /token plus the Authorization header. See JWT.
Frontend separation
If the React frontend lives in another repository, publish a versioned SDK from your application's OpenAPI spec and let the frontend install it. Signet's generated client is a base for that SDK; see Frontend client.
Publishing the documentation site
The Fumadocs site is a Next.js app that needs a Node/server runtime: the documentation
pages are pre-rendered, but the search and playground-proxy routes and middleware are
dynamic. Set NEXT_PUBLIC_SIGNET_API_URL to the public API origin (including the mount
prefix, e.g. https://api.example.com/auth), run npm run build in docs-site/, and
deploy it to a host that can run the Next.js server. A static-only host would lose the
playground proxy and search. The value gives the API playground a real base URL; it is
injected at build time only and does not alter the published spec.