Skip to main content
Version: v1 (Current)

Dev Tools

The GxP Toolkit includes powerful debugging tools to help you develop and test your plugins.

In-Browser Dev Tools​

Press Ctrl+Shift+D (or Cmd+Shift+D on Mac) to toggle the in-browser development tools.

Features​

Store Inspector​

Inspect the supported store sections and edit available values in the preview:

  • pluginVars - Settings from your manifest
  • stringsList - Translatable strings
  • assetList - Asset URLs
  • triggerState - Runtime state

Interactive features:

  • Hover over keys to highlight matching elements on the page
  • Double-click settings, strings, or dependency values to edit them in real-time
  • Changes are reflected immediately in your plugin

Edits are preview-state changes, not a save to app-manifest.json or the platform. Values entered in the editor are parsed as JSON when possible: 123, true, and null become their corresponding types. Enter a quoted JSON string if you need a numeric-looking string. Invalid JSON remains plain text. Use the relevant manifest or platform configuration workflow for durable changes.

Press Enter or leave the field to apply an edit; Escape cancels it. The current asset, trigger-state, and logged-in-user rows are display-only despite update helpers existing in the store. Use the console helpers or the relevant source/configuration workflow to change those values. Refresh currently logs a refresh message rather than fetching configuration again. Copy JSON exports settings, strings, assets, trigger state, and dependencies; it does not export the entire session or persist anything.

Layout Switcher​

Toggle between different layout contexts:

  • Public - Public-facing layout (unauthenticated users)
  • Private - Authenticated user layout
  • System - Minimal wrapper for system pages such as login or errors

This simulates how your plugin appears in different platform contexts.

Selecting a Private or System layout changes the wrapper; it does not log in a user, grant permissions, or prove that production authorization will allow the same operation.

Socket Simulator​

Send test socket events to your plugin:

  1. Select one of the built-in event cards
  2. Modify the JSON payload if needed
  3. Click "Send" to emit the event

This exercises a local socket event path. The current cards are AiSessionMessageCreated, SocialStreamPostCreated, and StateChange. A successful send entry is not a durable backend receipt. The local relay broadcasts globally and does not implement production channel authorization. See Socket Events for connection prerequisites, payload shapes, and simulator limitations.

Mock Data Editor​

Edit platform-provided mock data:

  • Theme colors - Primary, secondary, background colors
  • Navigation - Editor-local navigation entries
  • User Session - Editor-local identity fields
  • Permissions - Toggle permission flags

The current editor has no dependency section; inspect dependencies in the Store tab. Its controls have different effects:

ControlActual effect
Theme colorUpdates editor state and writes store.theme[key] only when that object exists
Navigation/User SessionChanges editor-local data; does not configure the router or log in a user
Permission checkboxReplaces the existing store.permissionFlags array with the editor's active list
Add custom permissionAdds an editor-local entry; store synchronization happens on a later checkbox toggle
Reset All to DefaultsResets editor-local values; does not restore every previously changed store field
Export as JSONCopies the editor's theme/navigation/user/permission data to the clipboard

The active permission list starts empty rather than loading existing flags. A checkbox change can therefore replace previously populated preview flags. These are local simulation controls; backend permissions must be configured and verified on the platform.

Console API​

Access dev tools programmatically from the browser console:

// Open/close dev tools
window.gxDevTools.open()
window.gxDevTools.close()
window.gxDevTools.toggle()
window.gxDevTools.isOpen()

// Access the store directly
const store = window.gxDevTools.store()
console.log(store.stringsList)
store.updateState("test_value", 123)

// Change layout
window.gxDevTools.setLayout("private")
window.gxDevTools.setLayout("public")
window.gxDevTools.setLayout("system")

// Get current layout
const layout = window.gxDevTools.getLayout()
console.log(layout) // 'private'

// In-page inspector; a browser extension is not required
window.gxDevTools.toggleSelect()
window.gxDevTools.toggleLocate()
console.log(window.gxDevTools.inspectorMode())

Browser Extensions​

The toolkit includes browser extensions for Chrome and Firefox that provide advanced inspection capabilities.

Installation​

Chrome​

# Request Chrome launch with the extension-loading flags
gxdev dev --chrome

# Or install manually:
# 1. Go to chrome://extensions
# 2. Enable "Developer mode"
# 3. Click "Load unpacked"
# 4. Select the path printed by gxdev ext:install chrome

Firefox​

# Request Firefox launch (requires separately installed web-ext tooling)
gxdev dev --firefox

# Or install manually:
# 1. Go to about:debugging
# 2. Click "This Firefox"
# 3. Click "Load Temporary Add-on"
# 4. Select manifest.json from the path printed by gxdev ext:install firefox

Confirm the extension actually loaded before testing it. Browser restrictions, the Firefox tooling installation, packaging, fixed inspector API address, and proxy permissions are covered in Browser Extensions. A successful launcher exit is not installation acceptance.

Extension Features​

Element Selection​

Click the selection tool in the DevTools panel, then click any element on the page to inspect it.

Visual Highlighting​

  • Hover - Orange dashed border shows element boundaries
  • Selected - Cyan pulsing glow indicates the selected element

Smart Labels​

Elements are labeled with their component context:

ComponentName::element::gxp-string-key

Examples:

  • DemoPage::h1::welcome_title
  • CheckInForm::button::btn_submit
  • Header::img::logo

String Extraction​

Identify hardcoded strings and convert them to gxp-string directives:

  1. Select an element with hardcoded text
  2. Click "Extract to gxp-string"
  3. Enter a key name
  4. When connected to its local API, the extension writes the Vue source and app-manifest.json; review the resulting diff

Component Inspector​

View Vue component details:

  • Selected component name and file metadata
  • Props and their values
  • Serialized component data snapshots
  • Setup-state values; no separate computed-property view or browsable component hierarchy is guaranteed

Reloading Extensions​

After modifying extension code in browser-extensions/:

Chrome:

  1. Go to chrome://extensions
  2. Find "GxP Developer Toolkit"
  3. Click the refresh icon

Firefox:

  1. Go to about:debugging
  2. Find "GxP Developer Toolkit"
  3. Click "Reload"

CLI Dev Commands​

Datastore Commands​

# List all store variables
gxdev datastore list

# Add a new variable interactively
gxdev datastore add

# Scan components for hardcoded strings
gxdev datastore scan-strings

The legacy scan command prompts for one component and candidate strings. Accepted entries are saved in src/stores/test-data.json; it does not update the manifest or rewrite Vue source. For example:

Component file path (e.g., src/Plugin.vue): src/CheckInForm.vue
Add "Welcome to the event" as "welcome_to_the_event"? (y/N):

Socket Commands​

# List available socket events
gxdev socket list

# Send an event template returned by the list command
gxdev socket send --event AiSessionMessageCreated

The sender reads the JSON event file; --data is not a supported payload override in the current handler. Edit a project event template or use the in-browser simulator's payload editor. The sender targets HTTPS localhost, so confirm relay certificates/protocol first. See Socket Events.

Asset Commands​

# List development assets
gxdev assets list

# Initialize asset directories
gxdev assets init

# Generate placeholder images
gxdev assets generate --size 400x300 --name hero
gxdev assets generate --size 200x200 --name avatar --format png

Image generation requires ImageMagick (magick or convert) and writes to dev-assets/images/. Reusing a name targets the same output paths. See placeholder generation before running these commands.

Debugging Tips​

1. Use Vue DevTools​

Install the Vue DevTools browser extension for component inspection:

  • Component tree visualization
  • State inspection
  • Relationships between component nodes

2. Enable Source Maps​

Check the browser Sources panel to find transformed modules and available original source mappings. Do not assume development mappings are included in the production archive; inspect the build configuration and emitted files separately.

3. Console Logging​

Use the store's console helpers:

const store = window.gxDevTools.store()

// Log current preview state
console.log("Settings:", store.pluginVars)
console.log("Strings:", store.stringsList)
console.log("State:", store.triggerState)

4. Network Tab​

Monitor API calls in your browser's Network tab. The local proxy can log upstream requests in the terminal. Inspect the actual URL, status, and response instead of using a log entry as proof of successful storage.

5. Hot Reload Issues​

If hot reload stops working:

  1. Check the terminal for Vite errors
  2. Look for syntax errors in your components
  3. Try a manual page refresh
  4. Restart the dev server if needed

Troubleshooting​

Dev tools not opening​

  • Ensure you are on the configured development-preview origin
  • Check browser console for JavaScript errors
  • Try refreshing the page

Extension not highlighting elements​

  • Reload the extension after code changes
  • Check console for [GxP Inspector] Loaded message
  • Ensure you're inspecting the correct tab

Store changes not reflecting​

  • Verify your manifest syntax is valid JSON
  • Check for typos in key names
  • Ensure you're using the correct getter method