HTTP admin surface for variant CRUD.
Mount this plug under whatever path your host exposes (the admin routes are intentionally relative — no baked-in prefix).
| Method | Path | Action |
|---|---|---|
GET | / | List all variants. |
GET | /:name | Fetch one variant. |
POST | / | Create a variant. 409 on name conflict. |
PUT | /:name | Upsert a variant. |
PATCH | /:name | Partial update of an existing variant. |
DELETE | /:name | Delete a variant. |
Request bodies use the canonical variant JSON shape:
{
"name": "thumbnail",
"options": "width=200,height=200,fit=cover,format=webp",
"metadata": {"description": "card thumbnail"},
"never_require_signed_urls": false
}options is a provider-specific options string parsed by the
configured provider (Cloudflare by default).
Configuration
:provider— module used to parse theoptionsstring. Defaults toImage.Plug.Provider.Cloudflare.:variant_store—{module, options}tuple identifying the variant store. Defaults to{Image.Plug.VariantStore.ETS, []}.
Authentication
This plug does not authenticate or authorise requests. Wrap it
in your host's auth pipeline (e.g. a :basic_auth plug or a
Phoenix :require_admin pipeline) before exposing it publicly.