Semaphor

Feature Visibility

Control which dashboard features are visible to your users

Overview

When embedding dashboards and self-service experience, you can control which UI features are visible to your end users. Pass a config object in the token request to show or hide specific elements like the SQL editor, info tab, or AI assistant.

All features are enabled by default. You only need to pass config when you want to disable something.


Available Options

OptionDefaultDescription
showAdvancedModetrueControls the Advanced Mode toggle in the visual editor. When enabled, users can switch to the SQL editor to write and modify queries directly.
showInfoTabtrueControls the Info tab in the visual editor. The Info tab displays query execution details and diagnostics.
showDashboardAssistanttrueControls the AI-powered dashboard assistant panel. When enabled, users can interact with the assistant to generate charts and get insights.

Setting Feature Visibility

Pass the config object in your token request body. This works for both dashboard tokens and project tokens.

Dashboard Token

const requestBody = {
  dashboardId: DASHBOARD_ID,
  dashboardSecret: DASHBOARD_SECRET,
  config: { 
    showAdvancedMode: false, 
    showDashboardAssistant: false, 
  }, 
};
 
const response = await fetch(TOKEN_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(requestBody),
});

Project Token

const requestBody = {
  type: 'project',
  projectId: PROJECT_ID,
  projectSecret: PROJECT_SECRET,
  endUserId: 'user_123',
  config: { 
    showAdvancedMode: false, 
    showInfoTab: false, 
  }, 
};
 
const response = await fetch(TOKEN_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(requestBody),
});

Security Note

The token generation function must be run on the server side. Do not expose DASHBOARD_SECRET or PROJECT_SECRET in client-side code in production.


Default Behavior

All Features Enabled by Default

You only need to pass config when you want to explicitly disable a feature. Setting a flag to false hides it; omitting it or setting it to true keeps it visible.


  • Token Options -- All available options when generating embed tokens
  • Tokens API -- Full API reference for token generation

On this page