diff --git a/Jellyfin.Plugin.Herald/Injection/FileTransformationRegistrar.cs b/Jellyfin.Plugin.Herald/Injection/FileTransformationRegistrar.cs
new file mode 100644
index 0000000..ba0d1d3
--- /dev/null
+++ b/Jellyfin.Plugin.Herald/Injection/FileTransformationRegistrar.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Loader;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+namespace Jellyfin.Plugin.Herald.Injection;
+
+///
+/// Registers the index.html transformation with the File Transformation plugin at startup.
+/// That plugin lives in its own load context, so it is only ever touched through reflection.
+///
+public class FileTransformationRegistrar : IHostedService
+{
+ private const string InterfaceTypeName = "Jellyfin.Plugin.FileTransformation.PluginInterface";
+ // File Transformation treats this as a regular expression. Unanchored, "index.html" would also
+ // match script chunks such as "session-login-index-html..chunk.js".
+ private const string IndexHtmlPattern = @"^index\.html$";
+ private static readonly Guid _transformationId = Guid.Parse("bf6fabc9-721c-46d9-9e13-3cc415a9ae1b");
+
+ private readonly ILogger _logger;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The logger.
+ public FileTransformationRegistrar(ILogger logger)
+ {
+ _logger = logger;
+ }
+
+ ///
+ public Task StartAsync(CancellationToken cancellationToken)
+ {
+ try
+ {
+ Register();
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Registering with the File Transformation plugin failed. Notices will not pop up until the client script is added manually (see the Herald README)");
+ }
+
+ return Task.CompletedTask;
+ }
+
+ ///
+ public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
+
+ private void Register()
+ {
+ var assembly = AssemblyLoadContext.All
+ .SelectMany(context => context.Assemblies)
+ .FirstOrDefault(a => a.FullName?.Contains(".FileTransformation", StringComparison.Ordinal) ?? false);
+
+ if (assembly is null)
+ {
+ _logger.LogWarning("The File Transformation plugin is not installed, so the Herald client script is not injected into the web client and notices will not pop up. Install File Transformation, or add the script manually (see the Herald README)");
+ return;
+ }
+
+ var register = assembly.GetType(InterfaceTypeName)?.GetMethod("RegisterTransformation", BindingFlags.Public | BindingFlags.Static);
+ var payloadType = register?.GetParameters().FirstOrDefault()?.ParameterType;
+
+ // The payload is a Newtonsoft JObject from File Transformation's own context; build it there.
+ var parse = payloadType?.GetMethod("Parse", BindingFlags.Public | BindingFlags.Static, [typeof(string)]);
+ if (register is null || parse is null)
+ {
+ _logger.LogWarning("The installed File Transformation plugin ({Assembly}) does not expose the expected registration API. The Herald client script is not injected", assembly.FullName);
+ return;
+ }
+
+ var json = JsonSerializer.Serialize(new
+ {
+ id = _transformationId,
+ fileNamePattern = IndexHtmlPattern,
+ callbackAssembly = typeof(IndexHtmlTransformer).Assembly.FullName,
+ callbackClass = typeof(IndexHtmlTransformer).FullName,
+ callbackMethod = nameof(IndexHtmlTransformer.Transform)
+ });
+
+ register.Invoke(null, [parse.Invoke(null, [json])]);
+ _logger.LogInformation("Registered the Herald client script with File Transformation {Version}", assembly.GetName().Version);
+ }
+}
diff --git a/Jellyfin.Plugin.Herald/Injection/IndexHtmlPayload.cs b/Jellyfin.Plugin.Herald/Injection/IndexHtmlPayload.cs
new file mode 100644
index 0000000..57a141c
--- /dev/null
+++ b/Jellyfin.Plugin.Herald/Injection/IndexHtmlPayload.cs
@@ -0,0 +1,12 @@
+namespace Jellyfin.Plugin.Herald.Injection;
+
+///
+/// The object File Transformation hands to a transformation callback.
+///
+public class IndexHtmlPayload
+{
+ ///
+ /// Gets or sets the current contents of the requested file.
+ ///
+ public string? Contents { get; set; }
+}
diff --git a/Jellyfin.Plugin.Herald/Injection/IndexHtmlTransformer.cs b/Jellyfin.Plugin.Herald/Injection/IndexHtmlTransformer.cs
new file mode 100644
index 0000000..a4558d7
--- /dev/null
+++ b/Jellyfin.Plugin.Herald/Injection/IndexHtmlTransformer.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Globalization;
+
+namespace Jellyfin.Plugin.Herald.Injection;
+
+///
+/// Adds the Herald client script to jellyfin-web's index.html.
+/// Invoked by the File Transformation plugin through reflection.
+///
+public static class IndexHtmlTransformer
+{
+ ///
+ /// Marks the injected tag so it is never added twice.
+ ///
+ public const string Marker = "data-herald-client";
+
+ ///
+ /// Gets the script tag that loads the client. The path is relative to /web/, so it survives a base URL.
+ ///
+ public static string ScriptTag
+ {
+ get
+ {
+ var version = typeof(IndexHtmlTransformer).Assembly.GetName().Version?.ToString() ?? "0";
+ return string.Format(CultureInfo.InvariantCulture, "", Marker, version);
+ }
+ }
+
+ ///
+ /// Transformation callback.
+ ///
+ /// The file contents as provided by File Transformation.
+ /// The transformed contents.
+ public static string Transform(IndexHtmlPayload payload)
+ {
+ return Inject(payload?.Contents ?? string.Empty);
+ }
+
+ ///
+ /// Inserts the script tag before the closing body tag. Content without one is not a page and is left alone.
+ ///
+ /// The page.
+ /// The page with the script tag.
+ public static string Inject(string html)
+ {
+ ArgumentNullException.ThrowIfNull(html);
+
+ if (html.Contains(Marker, StringComparison.Ordinal))
+ {
+ return html;
+ }
+
+ var index = html.LastIndexOf("