Skip to main content

Account Configuration

This guide covers setting up Token-Based Authentication (TBA) and managing multiple NetSuite accounts in your SDF project.


Authentication Flow

┌─────────────────────────────────────────────────────────────────────────────┐
│ TOKEN-BASED AUTHENTICATION FLOW │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ VSCode │ │ NetSuite │ │ Your │
│ (SDF CLI) │ │ Server │ │ Account │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
│ 1. Request + Token │ │
│────────────────────────►│ │
│ │ │
│ │ 2. Validate Token │
│ │────────────────────────►│
│ │ │
│ │ 3. Token Valid │
│ │◄────────────────────────│
│ │ │
│ 4. Access Granted │ │
│◄────────────────────────│ │
│ │ │
│ 5. Deploy/Import │ │
│────────────────────────►│ │
│ │ │

Setting Up Token-Based Authentication

Step 1: Create Integration Record (Admin Required)

In NetSuite:

  1. Go to Setup → Integration → Manage Integrations → New
  2. Configure:
FieldValue
NameSuiteCloud Development
StateEnabled
Token-Based Authentication✓ Checked
  1. Save and note the Consumer Key and Consumer Secret

Step 2: Create Access Token

  1. Go to Setup → Users/Roles → Access Tokens → New
  2. Configure:
FieldValue
Application NameSuiteCloud Development
UserYour user account
RoleAdministrator or Developer role
Token NameVSCode Development
  1. Click Save
  2. IMPORTANT: Copy the Token ID and Token Secret immediately (shown only once!)
┌─────────────────────────────────────────────────────┐
│ Access Token Created │
├─────────────────────────────────────────────────────┤
│ │
│ Token ID: abc123def456ghi789jkl012... │
│ Token Secret: xyz987wvu654tsr321qpo098... │
│ │
│ ⚠️ SAVE THESE NOW - Cannot be retrieved later! │
│ │
└─────────────────────────────────────────────────────┘

Configure Account in VSCode

Method 1: VSCode Command Palette

  1. Press Ctrl+Shift+P
  2. Type "SuiteCloud: Set Up Account"
  3. Enter credentials when prompted:
┌─────────────────────────────────────────────────────┐
│ Account Setup │
├─────────────────────────────────────────────────────┤
│ │
│ Account ID: _________________________ │
│ (e.g., TSTDRV1234567 or 1234567) │
│ │
│ Authentication: Token-Based Authentication │
│ │
│ Token ID: _________________________ │
│ │
│ Token Secret: _________________________ │
│ │
│ Save account as: _________________________ │
│ (e.g., "Sandbox" or "Production") │
│ │
└─────────────────────────────────────────────────────┘

Method 2: Terminal Command

suitecloud account:setup

Follow the interactive prompts.


Managing Multiple Accounts

Typical Setup

Most developers work with multiple accounts:

┌─────────────────────────────────────────────────────────────────────────────┐
│ MULTI-ACCOUNT SETUP │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────────────┐
│ Your VSCode │
│ Project │
└────────┬─────────┘

├────────────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Sandbox │ │ Production │
│ TSTDRV1234567 │ │ 1234567 │
│ (Development) │ │ (Live) │
└──────────────────┘ └──────────────────┘
│ │
│ │
▼ ▼
For testing For deployment
Safe to break Be careful!

Add Multiple Accounts

Run setup for each account:

# Setup Sandbox
suitecloud account:setup
# Name it: "Sandbox"

# Setup Production
suitecloud account:setup
# Name it: "Production"

List Configured Accounts

suitecloud account:list

Output:

┌─────────────────────────────────────────────────────┐
│ Configured Accounts │
├─────────────────────────────────────────────────────┤
│ │
│ 1. Sandbox (TSTDRV1234567) ← Default │
│ 2. Production (1234567) │
│ │
└─────────────────────────────────────────────────────┘

Switch Default Account

# Set Sandbox as default
suitecloud account:setdefault --account "Sandbox"

# Set Production as default
suitecloud account:setdefault --account "Production"

Account Credentials Storage

Credentials are stored securely in your system's credential manager:

OSStorage Location
WindowsWindows Credential Manager
macOSKeychain
LinuxSecret Service API

View Stored Credentials (Windows)

  1. Open Credential Manager (Control Panel)
  2. Look under Windows Credentials
  3. Find entries starting with suitecloud_

Role Requirements

Your NetSuite user role must have these permissions:

PermissionRequired For
SuiteCloud Development IntegrationBasic SDF operations
SuiteScriptDeploying scripts
Custom RecordsDeploying custom records
Saved SearchesDeploying saved searches
WorkflowDeploying workflows

Create a dedicated "SDF Developer" role with:

  • Setup → SuiteCloud Development → SuiteCloud Development Integration: Full
  • Lists → Custom Records: Full
  • Setup → SuiteScript: Full
  • Reports → Saved Searches: Full

Deployment to Specific Account

Using VSCode

  1. Ctrl+Shift+P → "SuiteCloud: Deploy to Account"
  2. Select target account from list

Using Terminal

# Deploy to default account
suitecloud project:deploy

# Deploy to specific account
suitecloud project:deploy --account "Sandbox"

# Deploy to Production
suitecloud project:deploy --account "Production"

Workflow: Sandbox to Production

┌─────────────────────────────────────────────────────────────────────────────┐
│ DEPLOYMENT WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────────┐
│ Develop │
│ (Local) │
└──────┬───────┘


┌─────────────────────────────────────┐
│ Deploy to Sandbox │
│ ───────────────────────────────────│
│ suitecloud project:deploy │
│ --account "Sandbox" │
└───────────┬─────────────────────────┘


┌─────────────────────────────────────┐
│ Test in Sandbox │
│ ───────────────────────────────────│
│ Verify functionality │
│ Check for errors │
│ User acceptance testing │
└───────────┬─────────────────────────┘


┌──────────────┐ No ┌─────────────────┐
│ Tests Pass? ├────────────►│ Fix & Redeploy │
└──────┬───────┘ └────────┬────────┘
│ Yes │
│ ◄──────────────────────┘

┌─────────────────────────────────────┐
│ Code Review (Pull Request) │
│ ───────────────────────────────────│
│ Team reviews changes │
│ Approve for production │
└───────────┬─────────────────────────┘


┌─────────────────────────────────────┐
│ Deploy to Production │
│ ───────────────────────────────────│
│ suitecloud project:deploy │
│ --account "Production" │
└───────────┬─────────────────────────┘


┌──────────────┐
│ LIVE! │
└──────────────┘

Troubleshooting

"Invalid Token" Error

  1. Verify Token ID and Secret are correct
  2. Check token hasn't expired
  3. Ensure token's role has required permissions
  4. Recreate token if necessary

"Account ID not found"

  1. Verify Account ID format:
    • Sandbox: TSTDRV1234567
    • Production: 1234567 (numbers only)
  2. Check for typos

"Role does not have permission"

  1. Log into NetSuite with the same user
  2. Check role has SuiteCloud Development permissions
  3. Ask administrator to update role

Reset Account Configuration

# Remove an account
suitecloud account:remove --account "AccountName"

# Re-setup
suitecloud account:setup

Security Best Practices

PracticeDescription
Separate tokensUse different tokens for Sandbox vs Production
Minimal permissionsOnly grant necessary permissions to role
Regular rotationRotate tokens periodically
Revoke unusedRemove tokens for departed team members
Don't shareEach developer should have their own token

Next Steps