Search titles and sections of every page. ↑↓ to move, ↵ to open

Plugins

Add what your app needs

A plugin adds hooks, middleware, endpoints or tags to every page. tern add puts one in your app’s main.go, and gets its module when it isn’t Tern’s own.

go tool tern add compress health

Tern’s own

compress

Gzips pages, data and JSON for clients that accept it, flushing streamed responses as they go.

go tool tern add compress

cors

Lets other origins call the app's endpoints, with preflight requests answered.

go tool tern add cors

health

Liveness and readiness endpoints, /healthz and /readyz, for load balancers and orchestrators.

go tool tern add health

images

Resizes remote images for <Image src="https://…">, with a disk cache.

go tool tern add images

metrics

Prometheus metrics at /metrics: requests by route and status, their durations, and the Go runtime.

go tool tern add metrics

ratelimit

Limits how often each client changes things, such as form actions and API writes, with 429 and Retry-After past the limit.

go tool tern add ratelimit

requestlog

Logs every request with slog: method, path, status, time and the request's ID.

go tool tern add requestlog

secure

Security headers on every response: no framing by other sites, trimmed referrers, powerful browser features off, and HSTS when asked.

go tool tern add secure

sessions

Per-user data in an encrypted, signed cookie.

go tool tern add sessions

Reads SESSION_SECRET

signals

Tells people from bots and recognizes devices, from TLS and HTTP fingerprints and a client check.

go tool tern add signals

oauth

Sign in with GitHub, Google or any OpenID Connect provider.

It needs each provider's client ID and secret: see the docs for the options.

oidc

Makes the app an OAuth 2.1 and OpenID Connect provider, with consent, for other apps and assistants.

It needs an issuer URL, a store and its clients: see the docs for the options.

From the community

None listed yet. Yours could be the first: see below.