Protecting Your Bundled Server SuiteScripts

NetSuite provides a mechanism for you to include server SuiteScripts in bundles, and prevent users who install the bundles from seeing the contents of these scripts. This mechanism is the Hide in SuiteBundle preference that you can enable on the script file record in the NetSuite File Cabinet.

For this preference to be available, you must upload your SuiteScript .js file to the File Cabinet and enable the Hide in SuiteBundle preference before you create the bundle that includes the server SuiteScript. (Note that this preference is not available for client SuiteScripts.)

File page highlighting Hide in SuiteBundle box.

Setting the Hide In SuiteBundle preference for a script is the only way to prevent target account users from seeing its code. Locking a bundled file, as described in Locking Objects in Customization Bundles, only prevents users from editing the script, not from viewing it or downloading it. For a comparison of setting the Hide in SuiteBundle preference and locking a bundled file, see Locked vs. Hidden Bundle Scripts Overview.

To prevent bundle installers from seeing server SuiteScript contents:

  1. Make sure your SuiteScript .js file is uploaded to the File Cabinet.

    For information, see Uploading Files to Your Account with SuiteCloud Extension for Visual Studio Code and Uploading SuiteScript scripts to the File Cabinet Without SuiteCloud IDEs.

  2. Before you create your bundle, go to Documents > Files > File Cabinet.

  3. Click the link for the File Cabinet folder where your script is located, to display its contents.

    Scripts generally are in the SuiteScripts folder, but may be located in another folder.

  4. Click Edit next to the script you want to protect.

  5. Check the Hide In SuiteBundle box.

  6. Click Save.


You should not check the Hide In SuiteBundle box for a script to be included in a bundle developed in sandbox. Checking this box for a script in the source sandbox account for the bundle can eventually lead to the script being hidden in that account. After the bundle is installed in production and the sandbox account is later refreshed, the production account setting for this option is copied to the sandbox account. This copy causes the Hide in SuiteBundle box to be checked and disabled in the source sandbox account, preventing bundle developers from accessing the script.

Related Topics

Bundle Builder Reference
Hiding Bundle Components in Target Accounts
Using Bundle Installation Scripts
Bundle Support during NetSuite Release Phasing
Documenting a Bundle
Locked vs. Hidden Bundle Scripts Overview
Defining Bundle Terms of Service
File and Folder Management in Bundles
Bundling NetSuite Financial Statements
Bundle Object Preferences
Locking Objects in Customization Bundles
Creating a Bundle with the Bundle Builder
Uploading Files to the File Cabinet
SuiteApps and Sandbox Accounts

General Notices