You need Node.js 20.10 or later, the Extension Developer Tools zip from your account’s File Cabinet, and token-based authentication enabled in each account you deploy to. Run gulp extension:fetch --to once per account to authorise the tools in your browser and generate a .nsdeploy file, keep a copy of each one, and swap them with a script. The whole thing takes about an hour the first time, and most of that is finding values inside NetSuite.
This is the setup I use on a live SuiteCommerce Advanced storefront with a production account and one sandbox. Oracle’s docs cover one account at a time. This covers running the same tools against two without editing config by hand.
What you need before you start
| Requirement | Minimum | How to check |
|---|---|---|
| Node.js | 20.10.0 | node --version |
| npm | 10.2.3 | npm --version |
| NetSuite access | Production and sandbox, with a role that can deploy | See the token section below |
| Extension Mechanism | Installed in both accounts | Customization > SuiteBundler > Search & Install Bundles |
| Token-based authentication | Enabled in both accounts | Setup > Company > Enable Features > SuiteCloud |
Oracle’s Install Node.js page lists the supported Node version per release. Stay close to it. The toolkit’s native dependencies are what break on a major version bump.
Token-based authentication is not optional. Since 2021.1 the developer tools no longer accept a NetSuite username and password, a change made for mandatory 2FA on Administrators. If the feature is off in either account, nothing below connects.
Install the tools
The Extension Developer Tools ship inside NetSuite, not on npm. Download the zip from the SuiteBundles folder of the File Cabinet, extract it somewhere outside your theme workspace, and install:
cd ExtensionDevelopmentTools-26.1.0
npm install
gulp helpnpm install runs a postinstall step that installs gulp-cli globally. If gulp help lists tasks, the install is good. gulp: command not found means your global npm bin directory isn’t on your PATH: run npm prefix -g, append /bin, and add that directory.
Authorise the tools
There is no integration record to create and no key to copy. The first time you fetch or deploy, the toolkit asks for an authentication ID, any label you like (prod and sandbox are enough), then opens NetSuite, where you pick the account and role and click Allow. The token it generates is saved in ~/.nstba under that label, the consumer key and secret land in .nsdeploy without you seeing them, and the label is what .nsdeploy stores as authID.
A clock is running on this. Oracle’s SOAP removal FAQ says that from 2027.1 no new integrations can be built with token-based authentication, and the Commerce developer tools still require it. Existing tokens keep working. Read the release notes before you set up a new account.
Which role. Oracle’s docs say Administrator and SCDeployer both carry the permissions to fetch and deploy. Use SCDeployer where you can: it holds only what the tools need, and a role that requires 2FA at login fails with INVALID_LOGIN_ATTEMPT. If Allow fails for the user you picked, check the employee record can hold tokens before you blame the role.
Find the values the config needs
The .nsdeploy file wants six values. This table is the one I wish someone had given me.
| Value | Where to find it | Looks like |
|---|---|---|
| Account ID | Setup > Company > Company Information | 1234567 |
| Hostname | Setup > Company > Company Information > Company URLs, the RESTlets row | 1234567.restlets.api.netsuite.com |
| Website ID | Setup > Website > Websites, the Internal ID column | 2 |
| Domain | Setup > Website > Domains, the active storefront domain | www.example.com |
| SSP folder ID | Documents > Files > File Cabinet > Web Site Hosting Files > Live Hosting Files > SSP Applications, then the id= in the URL | A seven-digit number |
| Webapp ID | Usually the same as the SSP folder ID. If a deploy fails on it, check the script deployments | Same shape |
Copy the hostname from Company URLs rather than typing it. Oracle’s page on account-specific domains says not to construct one yourself, and that it doesn’t change when the account moves data centre.
Generate the production config
You can fill .nsdeploy in by hand, but the fetch command fills most of it for you:
gulp extension:fetch --toWithout --to the toolkit reuses its last token. With it, you get the saved tokens by label and account plus a New token option, which starts the browser step above. Pick New token the first time. The tool then asks for the website and domain, downloads that domain’s activation manifest, and writes website, domain, webapp ID and SSP folder into .nsdeploy. Oracle’s fetch reference has the prompt sequence. The account comes from the token, so there is no --account flag.
Three things fetch does to your workspace. It asks before overwriting each custom extension, so answer No if you only want the config. It can only fetch custom extensions from your File Cabinet, so bundle-installed ones print “Cannot fetch packaged extension” and are skipped, which is expected. And it deletes Workspace/Extras and re-downloads the active theme into it, because extensions are compiled and validated against that copy.
That last one bit me on 26.1.0. Twice in a day the theme came back with its manifest, skins and templates but no assets folder and none of its Sass, and every deploy after that failed, first in validation and then in compile-sass with “Can’t find stylesheet to import”. The theme developer tools keep a full copy of the same theme, so copy the missing folders across:
rsync -a ThemeDevelopmentTools-26.1.0/Workspace/YourTheme/assets/ ExtensionDevelopmentTools-26.1.0/Workspace/Extras/YourTheme/assets/
rsync -a ThemeDevelopmentTools-26.1.0/Workspace/YourTheme/Modules/ ExtensionDevelopmentTools-26.1.0/Workspace/Extras/YourTheme/Modules/Then leave extension:fetch alone until you need it, since every run wipes the folder again.
When the fetch finishes, save the file before anything else touches it:
cp .nsdeploy .nsdeploy-productionSet up the sandbox
A sandbox is a copy of production with a suffix. Oracle’s sandbox page gives the account ID pattern, _SB1, and the account-specific domain turns that into a lowercase hyphenated prefix:
| Value | Production | Sandbox |
|---|---|---|
| Account ID | 1234567 | 1234567_SB1 |
| Hostname | 1234567.restlets.api.netsuite.com | 1234567-sb1.restlets.api.netsuite.com |
| Domain | www.example.com | staging.example.com |
The toolkit’s own prompts show the sandbox as 1234567-SB1, a third spelling, so don’t be thrown that none of them match.
Tokens are the part a refresh always destroys. Oracle is explicit that every sandbox refresh means creating new tokens there, so expect to click Allow again after each one.
Copy the production file, edit the three rows above and authID, and save it. A second fetch would do the same job but wipes the Extras theme on the way:
cp .nsdeploy .nsdeploy-sandboxWhat the config file looks like
The saved copies hold eight keys, and this is all you ever write by hand:
{
"credentials": {
"user_agent": "sc-extension-devtools/26.1.0",
"authID": "sandbox",
"hostname": "1234567-sb1.restlets.api.netsuite.com",
"is_scis": false,
"website": "2",
"domain": "staging.example.com",
"webapp_id": "YOUR_WEBAPP_ID",
"ssp_folder": "YOUR_SSP_FOLDER_ID"
}
}authID is the label from the authentication prompt and user_agent is the toolkit’s name and version. After the browser step the live .nsdeploy gains key, secret, account and a target_folder block, written by the toolkit, so you never paste the consumer secret yourself.
.nsdeploy is the live file the gulp tasks read. The other two are your saved copies. The live one holds the consumer secret in plain text, so all three go in .gitignore before your first commit:
.nsdeploy
.nsdeploy-*Switch environments with one command
Swapping configs is a file copy, so wrap it in npm scripts in the toolkit’s package.json:
{
"scripts": {
"config:sandbox": "cp .nsdeploy-sandbox .nsdeploy",
"config:production": "cp .nsdeploy-production .nsdeploy",
"deploy:sandbox": "npm run config:sandbox && gulp extension:deploy",
"deploy:production": "npm run config:production && gulp extension:deploy"
}
}Day to day:
| Task | Command |
|---|---|
| Switch to sandbox | npm run config:sandbox |
| Switch to production | npm run config:production |
| Deploy to sandbox | npm run deploy:sandbox |
| Deploy to production | npm run deploy:production |
| Fetch from sandbox | npm run config:sandbox && gulp extension:fetch --to |
Every flag the toolkit accepts is in Oracle’s gulp command reference.
Two things to know after the first deploy
It deploys one extension and rewrites every manifest. extension:deploy asks you to select one extension, uploads it and updates its record. On the way, an update-manifest task runs across the whole workspace: deploying one extension in a workspace of fifteen left fourteen other manifest.json files modified, reformatted and stripped of activation_id, extension_id, path and local_folder. Nothing in the source changed, and the values come back next deploy. Oracle’s deploy page documents --preserve-manifest for this, and it works: the same deploy with the flag left git status clean. Put it in your deploy scripts, as the toolkit’s own local:* scripts already do:
"deploy:sandbox": "npm run config:sandbox && gulp extension:deploy --preserve-manifest",
"deploy:production": "npm run config:production && gulp extension:deploy --preserve-manifest"The flag has one cost. It skips the rewrite, so the deploy validates your manifests against the files on disk and refuses if they disagree. Mine refused when a fetch had left the Extras theme without its assets. The copy above fixed it. A wall of “does not exists” lines means the same thing, and the cure is the copy, not dropping the flag.
Deploying is not activating. The same page says nothing changes on the site until you activate the extension in the Manage Extensions wizard. In my experience a production activation can time out on the JavaScript step in NetSuite’s queue. It leaves the live site untouched, and a retry later the same day went through, so retry before you re-deploy.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
cp: .nsdeploy-sandbox: No such file or directory | You ran a sandbox script before saving the file | Run the sandbox fetch and cp .nsdeploy .nsdeploy-sandbox |
| Network error or authentication failure | Wrong credentials, a revoked token, a hostname typed by hand, or an account ID mismatch | Check the token is still active under Setup > Users/Roles > Access Tokens, then check the hostname against Company URLs |
INVALID_LOGIN_ATTEMPT | The role you chose at Allow requires 2FA at login | Run --to again and choose SCDeployer |
| No domains offered during fetch | The domain is not set up in NetSuite yet | Wait for DNS, or fill webapp_id and ssp_folder by hand |
| Invalid domain | The config’s domain does not match Setup > Website > Domains | Fix the domain, and check it belongs to the website ID in the config |
| Deploy fails on webapp ID | webapp_id differs from ssp_folder on this account | Find the webapp ID in Script Deployments |
| Extension Mechanism bundle not found | The SuiteApp is not installed in this account | Install it through SuiteBundler, then activate |
A wall of does not exists lines for Workspace/Extras/... | A fetch re-downloaded the theme without its assets | Copy assets from the theme developer tools workspace |
Can't find stylesheet to import in compile-sass | The same fetch left out the theme’s Sass | Copy Modules from the theme developer tools workspace |
This post is part of the SuiteCommerce Advanced cluster. The tools I use for this work, including the editor and terminal setup, are on the resources page.