Examples
These pages show where server code plugs into your framework. Prefer @rendorix/client (Client library)—presets in config, img() in templates—so you are not re-implementing signing in each example. The walkthroughs below may use a placeholder signRendorixUrl to highlight where files live; swap that for rx.img(…) from a shared createRendorix instance. Background: HMAC signing and Generating image URLs (wire format vs manual build).
| Page | When to use it |
|---|---|
| Astro (static) | output: "static" or prerender; secrets in CI; URLs baked at build time. |
| Astro (SSR) | output: "server"; per-request signing on the adapter runtime (e.g. Cloudflare). |
| React (future) | Next.js, Remix, Vite + SPA + API—planned place for a dedicated sample repo link. |
Choosing an example
Section titled “Choosing an example”- If HTML is the same for every visitor and images are known at build time → start with Astro (static).
- If signed URLs must be short-lived or per-user → Astro (SSR) or a BFF that returns URLs to any static shell.
Prerequisite configuration
Section titled “Prerequisite configuration”Every example assumes you configure:
RENDORIX_BASE_URL(orPUBLIC_RENDORIX_BASE_URLfor the host string that is safe in the client) — e.g.https://img.example.com(Usage).RENDORIX_HMAC_SECRET(or your secret’s name) — server/CI only, neverPUBLIC_.
Recommended: use @rendorix/client and call createRendorix once (with baseUrl, secret, presets) then img(key, { preset, … }) on each path—see Client library. Only roll a custom signUrl if you are not on Node or you extend behavior beyond the package.
Contributing examples
Section titled “Contributing examples”When you publish a public repo or gist with a minimal working app, open a PR to add a link and a short blurb here—or expand React (future) with a concrete Next.js App Router snippet once the signing contract is stable.