# Tutorial for starting app developers: Developing a simple files plugin

**URL:** <https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231>\
**Category:** 💻 Development\
**Tags:** tutorial\
**Created:** [October 24, 2022, 11:47am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231 "2022-10-24T11:47:54Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [October 24, 2022, 11:47am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/1 "2022-10-24T11:47:54Z")

</div>

Edit: this tutorial is deprecated, due to changes in Nextcloud 28. There is a new tutorial available for beginners! See [Nextcloud](https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa?path=%2F%2F2%20Develop%20your%20first%20Hello%20World%20app)

– original post below-

Hello hello!

We have been working on a tutorial on how to develop a simple files plugin. This tutorial is perfect for everyone who have not developed Nextcloud apps before but who do have a working development environment. (If you don’t have a working development environment yet, then we have a tutorial for that too! [See here.](https://help.nextcloud.com/t/tutorial-how-to-set-up-a-nextcloud-development-environment-on-mac-or-ubuntu/145462))

The tutorial will guide you through the steps to add an extra action if you click on the three-dots icon next to a directory or file:

 ![image](https://help.nextcloud.com/uploads/default/original/3X/9/1/9135b976119a069307d3578895b52846075fb527.png)  
_Figure 1: “My directory action” added._

 ![image](https://help.nextcloud.com/uploads/default/original/3X/c/2/c2ac70fae741aa121b68b81cd21100ab2fd4364f.png)  
_Figure 2: “My file action” and “My pdf action” added._

You can find the tutorial here in the folder ‘Developing a simple files plugin’:

> **[Nextcloud app development tutorials final](https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa)**
>
> Nextcloud - a safe home for all your data

How difficult is it?  
This is not difficult.

Will there be tutorials for developing other types of apps?  
Yes, stay tuned 🙂

Will there be video tutorials?  
Yes! As a first step, we are looking for people who want to make screen recordings of the steps.

How to contribute?  
See the readme. Basically you can just download the source file, make your proposed changes, upload the file, and write me a mail.

We really hope this will be helpful for some of you 🙏

---

<div class="post-metadata">

**Author:** ![hermetic](https://help.nextcloud.com/user_avatar/help.nextcloud.com/hermetic/32/49307_2.png) [@hermetic](https://help.nextcloud.com/u/hermetic)\
**Post date:** [January 12, 2023, 4:46pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/2 "2023-01-12T16:46:22Z")

</div>

Hi Daphne,  
thank you for the tutorials.  
But I’m more looking for a tut, how to connect extern apps like suiteCRM (there is one, but it runs not on the newer Nextcloud 25.0.2/suiteCRM 8.2.2 -versions, also I read on the 7er version it has very few functionality yet).  
So a general docs how the connection/authorisation with extern apps works, maybe on the suiteCRM-example would be an idea?

---

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [January 12, 2023, 5:12pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/3 "2023-01-12T17:12:31Z")

</div>

hey @hermetic ! that sounds like a good idea indeed. I’ll discuss it to see if we can add it to the roadmap for the tutorials 🙂 thank you:)

---

<div class="post-metadata">

**Author:** ![hermetic](https://help.nextcloud.com/user_avatar/help.nextcloud.com/hermetic/32/49307_2.png) [@hermetic](https://help.nextcloud.com/u/hermetic)\
**Post date:** [January 12, 2023, 5:30pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/4 "2023-01-12T17:30:51Z")

</div>

Hey @Daphne,  
thank you for the fast reply. I also offer help.  
My Boss wants me to have a lot of extern apps connected, so it’s great when I can have some tips/docs.

Meanwhile I play a bit with nextcloud and app-skelettons. 😉 👍

---

<div class="post-metadata">

**Author:** ![Utopiah](https://help.nextcloud.com/user_avatar/help.nextcloud.com/utopiah/32/18773_2.png) [@Utopiah](https://help.nextcloud.com/u/Utopiah)\
**Post date:** [March 2, 2023, 2:12pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/5 "2023-03-02T14:12:51Z")

</div>

Hi, how does one update their app?

I followed the tutorial and it worked without problem. Now though I’m trying to modify the result and despite modifying version number, e.g 0.0.1 to 0.0.2 in appinfo/info.xml and package.json I can’t load the new version in Nextcloud. It would though be the usual development process, namely get some basic scaffolding working, test locally, update, etc until satisfied. Consequently documenting how to update a working app would help a lot.

---

<div class="post-metadata">

**Author:** ![prograde](https://help.nextcloud.com/letter_avatar/prograde/32/6_449c533f586939b6e5f246632a46421f.png) [@prograde](https://help.nextcloud.com/u/prograde)\
**Post date:** [March 3, 2023, 8:36pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/6 "2023-03-03T20:36:04Z")

</div>

Thanks for the tutorials, @Daphne! I wish they’d also cover how to run tests. I followed the tutorials but I’ve been struggeling for some time to get phpunit to run in the development environment.

---

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [March 7, 2023, 8:46pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/7 "2023-03-07T20:46:21Z")

</div>

hey, can you give some more details of what you mean you can’t load the app in Nextcloud? Maybe you can outline some exact steps to reproduce with some screenshots?

With the apps in these tutorials you should see the changes appear directly if you are developing in your local Nextcloud environment. No formal update process of upping the version number is necessary for these simple apps. A hard refresh / refresh with cleared browser cache of your browser should suffice to see the changes you made.

---

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [March 7, 2023, 8:46pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/8 "2023-03-07T20:46:30Z")

</div>

this is on the roadmap!

---

<div class="post-metadata">

**Author:** ![Utopiah](https://help.nextcloud.com/user_avatar/help.nextcloud.com/utopiah/32/18773_2.png) [@Utopiah](https://help.nextcloud.com/u/Utopiah)\
**Post date:** [March 8, 2023, 8:20am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/9 "2023-03-08T08:20:33Z")

</div>

Thanks Daphne, I’m not sure why I assumed this was necessary but indeed I restarted from a clean slate, i.e new plugin generated from skeleton, installed it, modified it straight from its location in the container, refreshed the page and voila, the updated code run. That’s great I now have an environment to iterate fast!

PS: taking the occasion to suggest syntax highlighting on the code files in the tutorial. Even on a short 10 lines example I find it makes understanding a lot easier.

---

<div class="post-metadata">

**Author:** ![Daphne](https://help.nextcloud.com/user_avatar/help.nextcloud.com/daphne/32/47373_2.png) [@Daphne](https://help.nextcloud.com/u/Daphne)\
**Post date:** [March 8, 2023, 9:32am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/10 "2023-03-08T09:32:14Z")

</div>

glad to hear it worked for you!

---

<div class="post-metadata">

**Author:** ![armymen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/armymen/32/28307_2.png) [@armymen](https://help.nextcloud.com/u/armymen)\
**Post date:** [August 31, 2023, 5:13pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/11 "2023-08-31T17:13:16Z")

</div>

Hello, thank you for this tutorial.

However, it does not work for me.

I cannot see the new button action showing up in the contextual menu.

The Javascript file is correctly loaded (it appears in the `<head>` section of the html with the correct content). Which means the PHP part is working correctly.

But the `registerAction` JS part seems to have no effect, since no additional button is added.

I have no errors showing up in the console. All the `console.debug('---------- directory...)` are not showing up.

Nextcloud locally installed on version **28.0.0 dev** following tutorial to set up local dev environement with docker.

Can you help me please ? Thanks !

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [September 1, 2023, 6:28am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/12 "2023-09-01T06:28:23Z")

</div>

The `console.log` calls should only be called as an actionHandler once the user clicked the button. So, unless you see the button in the context menu and click it in the UI, it should not log anything.

I fear there is something else failing. You could add a line like `console.log('File filesplugin.js was loaded')` to the file which should in fact create a message in the console.

Apart from that, you could check in the dev console of the browser what content is parsed in the js file and set some breakpoint etc eventually (not useful here right now). If the js file is not listed in the console, it is for some reason not found by the browser. You could have a look at the network tab of the file was not found by the browser (404) or similar. This should be visible in the logs as well but you can disable the errors there.

---

<div class="post-metadata">

**Author:** ![armymen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/armymen/32/28307_2.png) [@armymen](https://help.nextcloud.com/u/armymen)\
**Post date:** [September 1, 2023, 4:47pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/13 "2023-09-01T16:47:06Z")

</div>

Thank you for your response @christianlupus

I put some breakpoints in javascript code as you suggested, and everything looks normal. The `OCA.Files.fileActions.registerAction` seems to do its jobs, i.e. registering the action in the `OCA.Files.FileAction.actions` array. See screenshot : the three new actions are indeed in this array, after the page is fully loaded, alongside all the other actions.

 ![2023-09-01_18-30](https://help.nextcloud.com/uploads/default/original/3X/f/6/f6960596059041613216e912dd4b294370b3db3a.png)

On this second screenshot, we can see what options are loaded for the action linked to PDF files. For me, everything looks normal, isn’t it ?

 ![2023-09-01_18-22](https://help.nextcloud.com/uploads/default/original/3X/2/a/2a94be2480c626f258c5eb1ec1fd4ac28185b990.png)

I put some `console.log` at begining and enf of file as you suggested, and the code is executed. I also put a breakpoint inside the `actionHandler` method, but this breakpoint is never reached when I open the three dots menu.

So, from the outside, actions looks to be well registered. But, I still don’t see them on the user interface :

 ![2023-09-01_18-38](https://help.nextcloud.com/uploads/default/original/3X/2/c/2cae0351ba329f004ec9f86249765e6eeb6ec6fa.png)

Any ideas ? Thanks for your help  
.

---

<div class="post-metadata">

**Author:** ![wangme88](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wangme88/32/54518_2.png) [@wangme88](https://help.nextcloud.com/u/wangme88)\
**Post date:** [September 14, 2023, 11:50pm UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/14 "2023-09-14T23:50:52Z")

</div>

Hi, I’m a new developer to the scene. I am encountering the same issue as @armymen and have obtained the same debugging results. I also tried wrapping the JS code in `window.onload`, but to no avail. Any guidance would be appreciated. One thing I deviated from the tutorial is that I used a different APP name. The JS script seems to load only when it matches the APP name, but this might not be relevant to the issue under discussion.

---

<div class="post-metadata">

**Author:** ![Finski](https://help.nextcloud.com/letter_avatar/finski/32/6_449c533f586939b6e5f246632a46421f.png) [@Finski](https://help.nextcloud.com/u/Finski)\
**Post date:** [November 22, 2023, 10:53am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/15 "2023-11-22T10:53:27Z")

</div>

Hi everyone!

Unfortunately, regarding the file actions there was a **[breaking change](https://docs.nextcloud.com/server/latest/developer_manual/app_publishing_maintenance/app_upgrade_guide/upgrade_to_28.html)** in NC 28 which is why this tutorial no longer works and it has been deprecated.

I’m sorry for the trouble; we’re in the process of getting a replacement tutorial out as soon as possible.

Regards,  
Sami from Nextcloud

---

<div class="post-metadata">

**Author:** ![patrick-stickler](https://help.nextcloud.com/letter_avatar/patrick-stickler/32/6_449c533f586939b6e5f246632a46421f.png) [@patrick-stickler](https://help.nextcloud.com/u/patrick-stickler)\
**Post date:** [November 29, 2024, 11:35am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/16 "2024-11-29T11:35:25Z")

</div>

Is there an updated tutorial or other kind of example for creating a Nextcloud 30 compatible files plugin app? Is it imperative to use Vue or is there some way to add the action menu options with pure Javascript?

I’m trying to update an app that used a tab view and am not finding any clear documentation or examples.

Thanks.

---

<div class="post-metadata">

**Author:** ![christianlupus](https://help.nextcloud.com/user_avatar/help.nextcloud.com/christianlupus/32/22699_2.png) [@christianlupus](https://help.nextcloud.com/u/christianlupus)\
**Post date:** [December 8, 2024, 8:20am UTC](https://help.nextcloud.com/t/tutorial-for-starting-app-developers-developing-a-simple-files-plugin/148231/17 "2024-12-08T08:20:11Z")

</div>

Hello.

Vue is no requirement. It is just suggested to simplify development. But in fact it compiles down to plain js and css under the hood. So, this should be fine.

I am not sure, I get where you want to go. There is the library [@nextcloud/files](https://nextcloud-libraries.github.io/nextcloud-files/) that provides some functionality. If you wanted to grab deeper into the UI, this might only be possible by altering the actual Vue code in an effective fashion.

Chris
