Typed file markers for Nextcloud.

NextInject adds compact badges to matching files and can show safe, rule-based header actions inside public shares. It is admin-only, system-wide, and built for NC31 through NC33.

Public share preview
osite Network GmbH_AN-251218-02.pdf
matched by `_AN`
Offer
rechnung_RE-2026-04.pdf
matched by `_RE`
Invoice
delivery_LI-final.pdf
matched by `_LI`
Delivery

Small surface, clear behavior.

NextInject intentionally avoids arbitrary HTML injection. Admins define typed JSON rules, choose badge presets, and enable public-share actions only where they are needed.

Files and shares

Rules can match file names, share titles, folder paths, and public-share context. Matching items get a visual badge without changing the stored file.

Public actions

Offer and invoice flows can expose a controlled header button, such as Confirm offer, with placeholders for file and context labels.

Admin native

The configuration lives under Settings -> Administration -> NextInject, with import, export, defaults, and typed validation.

Rules are plain JSON.

Configuration remains portable and reviewable. The frontend receives only the runtime-safe subset required for matching and rendering.

{
  "id": "angebot",
  "label": "Offer",
  "matcher": "_AN",
  "surfaces": ["files", "public"],
  "badgePreset": "angebot",
  "headerAction": {
    "enabled": true,
    "label": "Confirm offer",
    "url": "https://example.com/confirm?file={fileName}",
    "variant": "primary"
  },
  "enabled": true,
  "priority": 300
}
  • Built-in presets Offer, invoice, delivery, order, protocol, and notice markers.
  • Safe migration Legacy `nextinject` and `elementinjector` settings are mapped to typed rules.
  • Theme compatibility Existing share styles such as cta_AN, AN_open, and gimmick_active are still supported.

Install it like a normal Nextcloud app.

The repository includes built assets for the app runtime and admin UI, so production installs do not need a server-side Node build.

Requirements

  • Nextcloud 31, 32, or 33
  • Admin access to the target instance
  • Write access to the Nextcloud apps directory

Quick install

cd /var/www/nextcloud/apps
git clone https://github.com/Yxanu/nextinject.git nextinject
chown -R www-data:www-data nextinject
sudo -u www-data php occ app:enable nextinject
sudo -u www-data php occ upgrade

Configure

Open Settings -> Administration -> NextInject, review the default rules, enable the public-share action where needed, then verify a matching file such as _AN.pdf.