- What is @kintone/customize-uploader ?
- Setting Up for @kintone/customize-uploader
- Appendix: Alternative Login Methods
The Kintone Customize Uploader is a command-line tool for uploading JavaScript and CSS files to Kintone. It allows the user to automatically upload JS and CSS files to a Kintone App when a change is made in the file.
The tool is published on npm and is available for Windows, macOS, and Linux.
⚠️ Node.js version 6 or later is needed to use this tool.
For more information on the Kintone Customize Uploader tool, refer to the Introduction to customize-uploader article.
To view the source code, refer to js-sdk/packages/customize-uploader at master · kintone/js-sdk.
- Update
customize-manifest.json
with App ID - Set your Kintone login credentials in the
.env
file
- Determine the App ID of the Kintone App you want to upload the customizations to.
- Replace the
180
value for the"app"
key in the template below with the App ID.
What is my App ID? To determine your Kintone App ID:
- Go inside the App
- Copy the URL
- Extract the digits after
https://YOUR_SUBDOMAIN.kintone.com/k/
Example: https://YOUR_SUBDOMAIN.kintone.com/k/1/
-> App ID is 1
{
"app": "180",
"scope": "ALL",
"desktop": {
"js": ["dist/KintoneCustomization.js"],
"css": []
},
"mobile": {
"js": [],
"css": []
}
}
By far, the simplest way to input your Kintone login credentials for the Kintone Customize Uploader is the .env
& env-cmd method.
- Duplicate the
.env.example
file and rename it.env
. - Input your Kintone login credentials
.env.example
KINTONE_BASE_URL=
KINTONE_USERNAME=
KINTONE_PASSWORD=
VIEW_ID=
.env
KINTONE_BASE_URL=https://cafe.kintone.com
KINTONE_USERNAME=Administrator
KINTONE_PASSWORD=KintoneIsAmazing!
VIEW_ID=1234567
- Make sure to keep the
.env.example
file since it is used by env-cmd to verify the environmental variable configuration.
The following two are alternative methods to input your Kintone login credentials for the Kintone Customize Uploader:
Executing only the npm run start
command will prompt an interactive login dialog. Input the Kintone subdomain, username, and password individually.
Login dialog:
? Input your kintone's base URL (https://example.cybozu.com): {kintoneBaseUrl}
? Input your username: {userLoginName}
? Input your password: [input is hidden] {yourPassword}
Example:
- ? Input your kintone's base URL (https://example.cybozu.com):
https://cafe.kintone.com
- ? Input your username:
Administrator
- ? Input your password: [input is hidden]
KintoneIsAmazing!
Success Message:
If you see the following message, you logged in successfully!
Generate customize-manifest.json from kintone app customize
Download Uploaded files on kintone app customize
Finish importing from kintone app customize
Environment variables for the Kintone subdomain and login information can be set in advance. Let's save time by not inputting login information per npm run start
command.
For Windows/ PowerShell
Set environment variables with Kintone information in advance by entering the following command in your PowerShell:
set-item "env:KINTONE_BASE_URL" <subdomain>.kintone.com
set-item "env:KINTONE_USERNAME" <user name>
set-item "env:KINTONE_PASSWORD" <user password>
Verify that the environment variables were set correctly:
# View all the environment variables
$env:path -split ";"
# View environment variables in the current directory
Get-Item .
For Mac/ Terminal
Set environment variables with Kintone information in advance by entering the following command in your Terminal:
export KINTONE_BASE_URL=<subdomain>.kintone.com
export KINTONE_USERNAME=<user name>
export KINTONE_PASSWORD=<user password>
Verify that the environment variables were set correctly:
echo $KINTONE_BASE_URL
echo $KINTONE_USERNAME
echo $KINTONE_PASSWORD