# How To Write Plugins Plugins were created to keep the app maintainable while still making it possible to easily implement additional functionality. There are essentially three different use cases for plugins: * Creating or extending server-side functionality, e.g. creating additional REST API endpoints * Offering article actions such as share via Twitter or E-Mail * Dropping in additional CSS or JavaScript ## The Basics Whatever plugin you want to create, you first need to create a basic structure. A plugin is basically just an app so you can take advantage of the full [Nextcloud app API](https://docs.nextcloud.org/server/latest/developer_manual/app/index.html). If you want you can [take a look at the developer docs](https://docs.nextcloud.org/server/latest/developer_manual/app/index.html) or [dig into the tutorial](https://docs.nextcloud.org/server/latest/developer_manual/app/tutorial.html). However if you just want to start slow, the full process is described below. First create the following directories and files: * **newsplugin/** * **appinfo/** * **app.php** * **info.xml** The first folder name affects the name and namespace of your plugin and only one app can exist using the same name. Choose wisely. First let's add some meta data about our app. Open the **newsplugin/appinfo/info.xml** and add the following contents: ```xml newsplugin Example News Plugin This plugin allows you to share articles via Twitter AGPL Your Name Here 0.0.1 ``` **Note**: You must license your app under the [AGPL 3 or later](http://www.gnu.org/licenses/agpl-3.0.en.html) to comply with the News app's license. Don't forget to add the license as plain text file if you want to distribute your app! Then we want to make sure that our code is only run if the News app is enabled. To do that put the following PHP code into the **newsplugin/appinfo/app.php** file: ```php ') .addClass('article-plugin-twitter'); var $button = $('