DW Profiles – Effortless dw.json Management for SFCC Developers in VS Code

Tired of copying dw.json between SFCC environments and projects? DW Profiles is a VS Code extension that lets you create, manage, and switch Salesforce Commerce Cloud profiles in one click.

How I Stopped Fighting With dw.json (and Built DW Profiles for VS Code)

If you work with Salesforce Commerce Cloud long enough, you eventually realize one thing: dw.json always shows up at the worst possible time.​

For me, that moment usually came when I was already deep into a feature on one project and suddenly needed to jump to another client, or switch from Development to Staging to verify a bug. Same codebase, different environments, different credentials – and the same fragile dw.json file in the root that I kept babysitting.

Over the years, my workflow quietly turned into a mess of habits that felt normal but were actually slowing me down.

Copy dw.json somewhere as a “backup”.

Rename files like dw.dev.json, dw.stage.json, dw.prod.json.

Manually paste credentials every time I switched environments.

Pray I didn’t accidentally commit a sensitive config or overwrite the wrong file.

It worked… until it didn’t.

One day, after juggling multiple SFCC projects in parallel, I realized I had no idea which dw.json belonged to which environment anymore. I had temp files everywhere, partial backups in random folders, and that tiny but real fear: “Did I just push the wrong dw.json to git?”

That was the moment I decided I needed a proper solution—not another script, not another naming convention, but something that actually fits how we work inside VS Code.


The Problem: Same Codebase, Different Environments, Constant Friction

My typical setup looks like this:

Multiple SFCC projects open in VS Code.

Each has Dev, Staging, and Production environments.

Most share similar codebases or at least similar tooling.

I switch contexts many times a day.

The reality:

dw.json lives in the workspace and expects a single “active” environment at a time.

Manually editing hostname, username, password, and code-version quickly becomes error‑prone.

Keeping backups outside the project feels hacky and is easy to forget.

VSCode Prophet and custom cartridge settings added even more fields to track.​

What I really wanted was simple:

A list of named SFCC profiles (Dev, Stage, Prod, Client A, Client B…).

A single click to apply one profile into dw.json.

A way to store these profiles safely without leaking credentials into git.

A UI that didn’t feel like fighting a wizard of sequential prompts.

So I built it.


Introducing DW Profiles – A Better Way to Manage SFCC dw.json in VS Code

DW Profiles is a VS Code extension that lets you create, edit, and apply multiple dw.json profiles directly from your editor.​

Instead of juggling files by hand, you define your environments once and then switch between them in a single click.

At a glance, DW Profiles gives you:

DW Profiles sidebar with all your SFCC environments in one place.​

unified profile editor – a modern Webview form where you edit all fields at once (hostname, username, password, code-version, cartridge, cartridgePath, and custom data).​

status bar indicator so you can always see and switch the active profile without leaving your keyboard flow.​

Environment‑specific icons (Shield for Production, Tools for Development, Package for Staging, Cloud for default) so you instantly know what you’re connected to.​

Multi‑root workspace support so each folder can use its own selected profile.​

Under the hood, the extension writes the selected profile into your workspace dw.json file and keeps unknown fields intact, so it plays nicely with existing setups and tools like Prophet.​


Keeping Credentials Safe: Profiles in Settings, Not in Git

One of my non‑negotiables was security and cleanliness of the repo. I didn’t want a convenient workflow that silently encouraged bad practices.

So DW Profiles stores:

All profile definitions in your VS Code global user settings (settings.json).​

The selected profile per workspace independently so different projects can use different environments at the same time.​

This means:

Your credentials never need to live in version control.

You can sync settings across machines if you want.

Projects stay clean, and only the current dw.json lands in the workspace.

You can even manually edit the JSON if that’s faster for you:

1"dwProfiles.profiles": [
2 {
3 "name": "Development",
4 "hostname": "development-xxx.demandware.net",
5 "username": "myuser",
6 "password": "mypassword",
7 "code-version": "version1"
8 },
9 {
10 "name": "Staging",
11 "hostname": "staging-xxx.demandware.net",
12 "username": "myuser",
13 "password": "mypassword",
14 "code-version": "version2"
15 }
16]
17


Define it once, then forget about it—DW Profiles takes over from there.


How It Fits Into a Real SFCC Workflow

Here’s what a typical day looks like now with DW Profiles:

Open the DW Profiles view from the Activity Bar in VS Code.​

Click + to create Dev, Staging, and Production profiles for the current project.​

Use the sidebar or the status bar to switch between environments as needed.​

Let the extension overwrite dw.json for you each time you switch.​

No more:

Hunting for old backups.

Copy‑pasting credentials.

Wondering if your dw.json is still in sync with the environment you think you’re using.

It feels like the small detail you never had time to fix that suddenly makes your day smoother.


Why I’m Sharing This

I originally built this extension to solve my own pain of working across multiple SFCC projects with shared codebases and different environments. But if you’ve ever:

Broken a dw.json while switching environments.

Accidentally pushed the wrong config.

Maintained a zoo of dw.*.json files.

…then you’re exactly who I had in mind.

If this sounds useful, try DW Profiles in your SFCC workflow and let me know what would make it even better. You can find the code, docs, and issue tracker on GitHub.

0%