About Kintone plug-ins

What are Kintone Plug-ins?

plugins.png

Kintone plug-ins are packaged customization files that can be imported into a Kintone environment, and installed into any App. Plug-ins provide an easy way for users to set up customizations in Kintone without having to touch or alter any code. 

 

Kintone plug-ins include JavaScript customization files, and plug-in settings page files. The plug-in settings page is where users can change the behavior of the customization through a GUI. If a user were to use a single JavaScript customization file for an App instead, in the instance that a change to the customization is necessary, the user would need to download the file, alter the code, and then upload it back to the App. Plug-ins make this process easier as it allows users to change settings through a GUI. 

Develop a Kintone Plug-in

For those looking to develop Kintone plug-ins, it is suggested to first read through the API Documentation Introduction section as well as the API Documentation in general to get a feel of how to work with Kintone-related data. In particular, be sure to check out the Plug-in JavaScript API provided specifically for the development of Kintone plug-ins. The Plug-in APIs section below gives a brief introduction to these APIs as well. 

 

Next, prepare an environment for developing plug-ins by following the Plug-in development environment article. 

 

Finally, read through the Steps for plug-in development article for in-depth details on the necessary files within a Kintone plug-in and how to package the final file.

Plug-in APIs

There are a number of Kintone APIs created specifically for developing Kintone plug-ins, largely based on saving and retrieving plug-in settings. This section explains the use of each API. For more detailed information such as parameters and responses, see the Plug-in JavaScript API document.

Set Config

kintone.plugin.app.setConfig()

setConfig() is used to save user input data on the plug-in settings page. The saved data can then be called using the getConfig() method. For example, in the case of a plug-in that changes the background color of a field when it equals a particular value, a drop-down element with various color choices may exist in the plug-in settings page. When a user selects the color from the drop down element and clicks the save button, setConfig() should be executed to save the selected value.   

Get Config

kintone.plugin.app.getConfig()

getConfig() is used to retrieve the values saved with the setConfig() method. In the case of the background-color plug-in described above, getConfig() should be executed during an event such as the Record List Onload Event. Doing so will retrieve the saved values that can be inputted into a function to change the field background color.

Kintone Plug-in Proxy

kintone.plugin.app.proxy()

proxy() is used to run 3rd party REST APIs. If it is necessary to utilize plug-in setting values with a 3rd party REST API, the settings must be saved with the setProxyConfig() method. Note that this API is different from the Kintone Proxy API.

Set Config for proxy()

kintone.plugin.app.setProxyConfig()

setProxyConfig() is similar in function to the setConfig() method, as it saves user inputs on the plug-in settings page. However, setProxyConfig() is to be used with the above proxy() method for 3rd party REST APIs. This method is commonly used to save usernames and passwords or API keys to use for authentication with 3rd party services.

Get Config for proxy()

kintone.plugin.app.getProxyConfig()

getProxyConfig() is similar in function to the getConfig() method, as it retrieves user inputs saved on the plug-in settings page. However, getProxyConfig() only retrieves values saved with the setProxyConfig() method, and can only be used on the Plug-in settings page. 

Kintone Plug-in Proxy Upload

kintone.plugin.app.proxy.upload()

proxy.upload() allows the user to upload a file to outside of Kintone using a plug-in. If the external REST API requires sending authentication information with the file data, use data saved with the setProxyConfig() method.

Was this article helpful?
0 out of 0 found this helpful
Do you have any questions or issues related to this article?
Please share your views with us in the Community forums!