> For the complete documentation index, see [llms.txt](https://docs.flopsar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flopsar.com/3.0/developer-guide/server-plugins.md).

# Server Plugins

Flopsar provides a few functionalities implemented as plugins. These implementations can be easily replaced with user-defined implementations. In this version of Flopsar only `Manager` supports plugins. There is one plugin currently available: *authentication*.

Flopsar provides a C API for writing custom implementations of plugins. In order to write a plugin, you need to include in your project the main header file `plugin.h` , which can be downloaded from our [GitHub repository](https://github.com/flopsar/plugin-api). This file contains prototypes of functions to implement. The function below is the most important one and must be implemented. This function is called only once when the application loads the plugin.

```c
int plugin_init(Plugin *p, const char *p_conf);
```

When you call the function above you will be provided with two arguments. The `p` argument is an opaque type representing your plugin. You should keep it since it is required when you register your plugin hooks. The `p_conf` argument is a path to your plugin configuration file. The second argument is provided only if you specify it during the plugin [installation](/3.0/administrator-guide/server.md#plugins).

{% hint style="warning" %}
Do not change the name of the function above. It must stay `plugin_init`, otherwise a plugin will not be loaded.
{% endhint %}

## Authentication Plugin

If you want to use your own authentication system, you must implement a plugin in order to be able to authenticate your users against this system.&#x20;

There is a default implementation of the authentication plugin available at [GitHub](https://github.com/flopsar/plugin-ldap). Use it as an example to implement your own.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flopsar.com/3.0/developer-guide/server-plugins.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
