# Plugins

> Extend DS Server with .NET plugins that add controllers, middleware and services: IPlugin, how the Plugins folder is loaded, package versions and security.

- **Product:** DS Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** DS Server > Plugins
- **1117 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/plugins/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/plugins/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/plugins/llms-full.txt

---

Plugins let you add your own code to DS Server instead of running it in a separate application beside the server: an endpoint of your own, a step in the request pipeline, a service that uses the document processing of DS Server. .NET developers who extend a DS Server installation find out here how plugins fit into the server, how to build and deploy one, which DS Server services a plugin can use, and how a plugin receives the documents signed in the Document Viewer.

### What a Plugin Is

A plugin is a .NET class library, compiled into a *.dll*, that DS Server loads when it starts. It contains a public class that implements the `IPlugin` interface of the NuGet package `TXTextControl.DocumentServices.Plugin.Abstractions`. Through this interface, a plugin can:

- **Add endpoints.** Its ASP.NET Core API controllers answer under the address of DS Server, for example at `/plugin/hello`.
- **Add middleware and route handlers** to the request pipeline of DS Server, for logging or metrics.
- **Register services** in the dependency injection container of DS Server, and read the configuration of DS Server, including its *appsettings.json* file.
- **Run code** when DS Server starts and when the plugin is unloaded.
- **Use DS Server's services.** Since version 5.0, `IDocumentProcessingService` gives a plugin the conversion, mail merge, PDF and barcode features of DS Server, and `IDocumentEditorSessionService` the documents open in the Document Editor.
- **Link a page** from the **Plugins** page of the admin portal.

Plugins are available since DS Server 4.1.0, released in September 2025. The services followed with DS Server 5.0.0.

### How DS Server Loads Plugins

Each plugin has its own subfolder in the *Plugins* folder of the DS Server installation, together with the assemblies it depends on:

```text
DS Server folder/
├── TXTextControl.DocumentServices.dll
├── appsettings.json
└── Plugins/
    ├── README.md
    ├── MyFirstPlugin/
    │   └── MyFirstPlugin.dll
    └── SigningPlugin/
        └── SigningPlugin.dll
```

When DS Server starts, it searches the subfolders for classes that implement `IPlugin` and loads them. Its console output lists each plugin with the name and version the plugin reports:

```text
Loading plugins from '/opt/dsserver/Plugins'...
Loaded plugin: MyFirstPlugin (v1.0.0)
```

A plugin that is added or updated takes effect only after DS Server is restarted. The **Plugins** page of the admin portal lists the loaded plugins with their name, version and description and whether each one is enabled.

> Warning
>
> **Plugin Endpoints and OAuth.** The endpoints of a plugin run in the same process as DS Server and use its address and port, but they are not covered by its OAuth protection. A plugin protects its own endpoints, with the access token validation of DS Server described in [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/#protect-the-endpoint-with-oauth).

### Versions

| DS Server | Package `TXTextControl.DocumentServices.Plugin.Abstractions` | What a plugin can use |
|---|---|---|
| 4.1.0 | 4.1.0, for .NET 8 | `IPlugin` and `PluginContext` |
| 5.0.0 and later | 5.0.0 or 5.0.1, for .NET 8 and .NET 10 | In addition, `IDocumentProcessingService`, `IDocumentEditorSessionService` and the constant `PluginContext.AuthenticationScheme` |

DS Server 5.0 is built with .NET 10, and the official sample plugin targets `net10.0`. The package and its types are documented in the reference: [Plugin.Abstractions](https://docs.textcontrol.com/ds-server/reference/dotnet-api/txtextcontrol-documentservices-plugin-abstractions/llms-full.txt).

### Find the Right Page

| If you want to | Read |
|---|---|
| Build, deploy and test a first plugin | [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/llms-full.txt) |
| Protect a plugin endpoint with an access token | [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/#protect-the-endpoint-with-oauth) |
| Convert or merge documents in a plugin | [Plugin Services](https://docs.textcontrol.com/ds-server/plugins/services/llms-full.txt) |
| Change the document a user has open in the Document Editor | [Plugin Services](https://docs.textcontrol.com/ds-server/plugins/services/#idocumenteditorsessionservice) |
| Receive the documents signed in the Document Viewer | [Custom Signing Endpoints](https://docs.textcontrol.com/ds-server/plugins/signing/llms-full.txt) |

### Where to Start

1. Build *MyFirstPlugin* in [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/llms-full.txt). It shows every step once: the project, the interface, the deployment, the log and the test.
2. Add the services you need from [Plugin Services](https://docs.textcontrol.com/ds-server/plugins/services/llms-full.txt).
3. For signing workflows, continue with [Custom Signing Endpoints](https://docs.textcontrol.com/ds-server/plugins/signing/llms-full.txt).

### Pages in This Section

- [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/llms-full.txt): create a class library, implement `IPlugin`, deploy it into the *Plugins* folder and protect its endpoint.
- [Plugin Services](https://docs.textcontrol.com/ds-server/plugins/services/llms-full.txt): use `IDocumentProcessingService` and `IDocumentEditorSessionService` in plugin controllers.
- [Custom Signing Endpoints](https://docs.textcontrol.com/ds-server/plugins/signing/llms-full.txt): receive signed documents from the Document Viewer in a plugin endpoint protected by an access token.

---

## In This Section

- [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/llms-full.txt): Build a DS Server plugin step by step: a .NET class library with IPlugin, a controller, middleware and settings, deployment, testing and OAuth protection.
- [Plugin Services](https://docs.textcontrol.com/ds-server/plugins/services/llms-full.txt): Merge, convert and inspect documents in a DS Server plugin with IDocumentProcessingService, and load or save editor sessions with IDocumentEditorSessionService.
- [Custom Signing Endpoints](https://docs.textcontrol.com/ds-server/plugins/signing/llms-full.txt): Receive documents signed in the Document Viewer in a DS Server plugin endpoint: SignatureData, RedirectUrlAfterSignature, access token checks and PDF storage.

---

## Nearby

- **Previous:** [Errors and Status Codes](https://docs.textcontrol.com/ds-server/document-processing/errors/llms-full.txt)
- **Next:** [Creating a Plugin](https://docs.textcontrol.com/ds-server/plugins/creating/llms-full.txt)
