Protecting Your Bundled Server SuiteScripts

You can include server SuiteScripts in bundles and prevent users who install the bundles from seeing the contents of these scripts.

To hide a server-side script in a bundle, you must upload your SuiteScript .js file to the File Cabinet and then edit the file record. On the file record, enable the Hide in SuiteBundle preference before you create the bundle that includes the server SuiteScript.

Note:

Script files that need to be accessed on the client-side cannot have the Hide in SuiteBundle preference enabled. This includes both client scripts and script files that are referenced inside of client scripts.

File page highlighting Hide in SuiteBundle box.
Important:

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.

    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.

Warning:

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

General Notices