Add URL parameters to a secure embed

After you generate a secure embed path that you plan to sign with your embed credentials, use specific query string parameters on the embed URL to define the functionality of your embed:

If you want to embed the tagged version of a workbook, reference the tag in the URL, then set query string parameters. See Link to a tagged version of a workbook.

The best way to construct the embed URL is with code. For an example using JavaScript, see Example embed API and URL.

This document provides an overview of all required and optional embed URL parameters.

Usage notes

Query string parameters are applied at the end of a URL path. The first parameter follows a question mark (?) and additional parameters are added after an ampersand (&).

For example:

https://app.sigmacomputing.com/embed/{embedID}?:nonce={nonce}&:client_id={CLIENT_ID}&:mode=userbacked

🚩

Unless otherwise noted, each parameter listed in these reference tables must be prepended with a colon (:). For example, the parameter "nonce" should appear as ":nonce" in your secure embed URL.

Values that you provide in the embed URL must be URL-encoded, with some exceptions:

  • If you provide multiple values for a parameter, such as for a user attribute, separate each value with a comma. Do not URL-encode the comma.
  • Key values, such as a user attribute name or value, a team, a custom account type, or a custom theme, must not be encoded. If your user attribute, account type, team, or theme name contains spaces or special characters other than an underscore (_), consider changing the name.

For details about how to URL-encode values, see Special characters for URL parameters.

Required parameters

The following parameters must be appended to the base URL (embed path) in the embed URL:

ParameterDescription
nonceA unique, random string used for security purposes. The value is valid for a single request.
client_idThe ID paired with and used to define the embed secret.
modeThe embed type (must be set to userbacked for secure embeds)
emailThe email address linked to the embed user's account.
external_user_idA unique identifier for the embed user. This can be the user_id value from the host application's security system, or another value associated with the individual user.
external_user_teamThe Sigma team referenced to determine access and permissions.
session_lengthThe duration (in seconds) of the embed URL's browser session validity. After the session expires, the embed URL must be regenerated with a new nonce.
timeA UNIX timestamp used with the session_length parameter.
signatureA Hash-based Message Authentication Code (HMAC) signature produced by combining the encrypted embed secret with a hash function. Unique to the message and key, the cryptographic signature authenticates the request and protects data integrity. This signature ensures that only parties with access to the secret key can verify the authenticity of the message.

Optional interface parameters

ParameterDescription
control_id

Set one or more values in a specific control element in the embedded content. Set one or more control values, depending on the type of control. See Set control values with query string parameters.

Unlike other parameters, do not prepend this parameter with a colon.

disable_mobile_viewWhen set to true, disables automatic resizing for a mobile layout.
eval_connection_idDynamically switch the connection being used for any query in the embed.

Not supported on OAuth connections.

See Embedding 13: Connection Swapping in the QuickStarts for a walkthrough of using this parameter.

Usage notes:

  • Connection switching is not supported when using write-back features, such as input tables or materialization.
  • Connection switching overrides any user attribute-based warehouse or role switching.
  • Scheduled exports use the connection in the URL at the time the schedule was created or modified.
  • Immediate exports use the connection from the current URL.
  • The connection is used for any workbook opened in the embed session.
  • The connection replaces all connections used in the workbook.
first_nameSet the first name of the current embed user. When set, the name displays in the folder menu and system-generated emails. Must be used with the last_name parameter. When one or both is absent, a new member created in Sigma is named Embed (first) User (last).
hide_folder_navigationWhen set to true, hides the folder navigation.
hide_menuWhen set to true, hides the embed menu in saved workbooks. Must be used with menu_position and only applies when menu_position is set to top or bottom.
hide_run_as_recipientWhen set to true, hides the Run queries as recipient option in the Send Now and Schedule Exports modals.
hide_scheduleWhen set to true, hides the Schedule exports option in the embed menu in saved workbooks.
hide_sendWhen set to true, hides the Send now option in the embed menu in saved workbooks.
hide_sheet_interactionsWhen set to true, hides sort and filter options in embedded elements.
hide_tooltipWhen set to true, hides chart mark tooltips.
last_nameSet the last name of the current embed user. When set, the name displays in the folder menu and system-generated emails. Must be used with the first_name parameter. When one or both is absent, a new member created in Sigma is named Embed (first) User (last).
loading_bgSpecify a custom background color with a hex code to the loading and error screens.
loading_textSpecify a custom font color with a hex code to the loading and error text.
lngApply an existing translation added via localization to the embed.
lng_variantApply a custom translation file added via localization to the embed. Must be used with lng.
menu_positionSpecify the toolbar position (top, bottom) or remove it (none). When no value is specified, defaults to bottom.
responsive_heightWhen set to true, enables developer access to the JavaScript event called workbook:pageheight:onchange.

For details, see the section about responsive iframes in the Embedding 10: Responsive Embeds Sigma QuickStart.
show_footerWhen set to false, hides the file explorer, workbook page tabs, Save As and Edit options, and Sigma logo in the embed footer.
showUnderlyingDataWhether the underlying data for a chart is shown when the embed first loads. When set to false, hides the underlying data behind a context menu. Only applicable to embeds that contain a single chart element.
themeApply a workbook theme by name, case sensitive. Specify one of the default workbook themes (Light, Dark, or Surface) or any custom theme defined for your organization.
use_user_nameDisplay the workbook owner's name instead of their email address in the embed menu and system-generated emails.

Optional security parameters

ParameterDescription
account_type

Apply the permissions granted to the specified account type.

Recommendation: Set a value with the lowest level of permissions (for example, View), unless the embed users must be granted a higher level of permissions.

Optional user attribute parameters

User attributes are variables that users assigned the Admin account type can create in Sigma. The host application can use the embed API to apply user attribute parameters and update values at runtime for individual users, affecting all sessions for those users.

Example use cases for user attributes:

Construct a user attribute parameter for a secure embed URL

To construct a user attribute parameter for a secure embed URL, do the following:

  • Prepend the name of the user attribute with :ua_
  • Include the name of the user attribute.
  • Set the user attribute parameter equal to one or more values

For example:

&:ua_Region=West,Midwest

📘

Do not encode any special characters in the name of the user attribute. If your user attribute contains special characters other than an underscore (_), consider renaming it.

Example code for user attribute parameters

Example JavaScript code to apply a user attribute parameter and value in the embed URL.

This example code assumes that you have two environment variables set up:

  • uaName to store the name of the user attribute.
  • uaValue to store the value of the user attribute.
//Pass the user attribute name from Sigma and value to set it to:
searchParams += '&:ua_{uaName}={uaValue}';

// Example output:
// searchParams += '&:ua_Region=East';

// or for multiple values:
// searchParams += '&:ua_{uaName}={uaValue1},{uaValue2}';
// searchParams += '&:ua_Region=East,West';