Embed the SDK on a page to display the complete DataPilot, or specify the agent's dialogue, semantic processing, and data applications within the host website. The client provides the platform URL, user login credentials, and target page. The SDK is responsible for loading the page, passing credentials, and updating configurations. The integration process is: prepare login credentials > initialize SDK > display page.
DataPilot provides three integration tools:
- Integration Guide: Includes preparation, implementation process, and API reference.
- API Playground (Embed Configuration Platform): Select views and resources, crop the page, preview the effect, and generate integration code.
- Integration Skill (Optional): For AI coding tools that support Agent Skills to generate SDK integration code.
Core concepts
Page embed sdk, host application, and embedded page
The Page Embed SDK is a JavaScript/TypeScript client library for loading DataPilot pages in web pages. The website that hosts the SDK is the host application, and the isolated-running DataPilot interface is the embedded page. The host application is responsible for navigation, account, and business access, while DataPilot provides the interface and capabilities.
Page Embed loads the complete page; Message Rendering Component renders only a single Agent message as a React component, with input fields, sessions, and data sources implemented by the integrator. The embedding behavior is determined by the platform URL, login credentials, and target page.
Tokens and two login methods
The SDK uses a DataPilot Token to identify the current user. Platform Account Login uses the accessToken returned from the login; Website Account Login Without Password has the host backend apply for a short-term Embed Token on behalf of the verified website user. Only login without password requires applying for an Embed Token, and the code must explicitly provide credentials to the SDK. The DataPilot login state from other tabs will not be automatically passed over.
Permissions come from the associated DataPilot account. Login without password requires administrator configuration of identity sources, binding website users to platform accounts, and saving embedded application credentials; Platform Account Login requires the host website to provide a login entry point. Both methods have consistent permission scopes.
View (which type of page to display)
Valid Views are global (full product), engineer (engineer workspace), analyst (analyst workspace), semantic (semantic processing), chat (intelligent dialogue), and buildArtifact (data application build artifacts).
global does not require parameters; engineer and analyst require a workspace ID, with an Agent ID optional; semantic and chat require both a workspace ID and an Agent ID; buildArtifact also requires a data application ID. The engineer page uses the Developer Edition Agent, while the analyst, dialogue, and build artifact pages use the Release Edition Agent with access rights, which may require prior subscription if necessary; these two types of Agent IDs cannot be mixed.
Layout clipping and default layout
Layout configuration controls the top bar, Logo, sidebar, dialogue area, top bar buttons, user menu entries, and engineer sidebar entry. Layouts can only be hidden, not granted more permissions; features set to true are still subject to user permission control, while setting them to false only hides the display.
unset items use the default layout of the current View. When switching Views, the SDK starts applying the settings from the new View's default layout, and configurations that need to be retained must be passed in again. For example, header: false hides the top bar. Personal email settings, password change, and logoff are always hidden in embedded scenarios.
Style customization and isolation
The embedded page is CSS-isolated from the host website. slotStyles in appearance modifies areas such as the sidebar, top bar, and chat area, while rules_UNSTABLE modifies specific elements like buttons and input fields.
Area names are stable; selectors marked as UNSTABLE depend on the page's internal structure and may need adjustment after a platform upgrade. Rounded corners on area containers do not automatically change the rounded corners of internal controls. Styles affect only the current embedded instance and its pop-ups, not other pages, instances, or nested second-level pages; invalid area names, selectors, or declarations will be rejected.
Access skill (optional)
An Access Skill is a compressed package containing page embedding specifications, used by AI coding tools that support Agent Skills to generate access code based on the existing project structure, login module, and directory. It aids development but does not participate in browser runtime; a matching version must be installed when upgrading the SDK.
Embed configuration console and live preview
The Embed Configuration Console in the API Playground provides configuration controls, a live DataPilot preview, and access code on the same screen. Changes to the View, resources, layout, or style are synchronized to update the preview and code.
Operations in the preview act directly on the real environment; for example, a publish operation publishes directly, making it suitable for first-verification with test resources.
Role definition
Role |
What You Can Do in This Module |
Description |
|---|---|---|
| Access Engineer / Integration Lead | Read the access guide, configure and preview the embedded configuration on the console, copy the access code, and download and use the access skill. | The primary users of this module should be able to access the spaces, agents, or data applications they intend to embed. |
| System Administrator | Register the sources of websites that are allowed to embed in system management. To enable login-free access for website accounts, configure the identity source and save the credentials for the embedded application. | Cross-origin source and identity integration is an administrator responsibility. |
| Engineers/Analysts on the Platform | As a user of the embedded page, you can normally operate the embedded interface on the host website. | Do not access the module entrance; capabilities still depend on the permissions of its platform account. |
| Backend of the host application | Save user credentials, apply for an Embed Token from the platform as needed, and provide a ticket retrieval interface to the SDK. | This is the implementation of the access party and is not displayed in the platform interface. |
Cross-domain embedding requires the system administrator to register the precise website source. For website account login-free access, you must also configure and enable the identity source and save the application credentials. The embedded page inherits the operations and permissions of the corresponding module; layout only controls display. The message rendering component uses a separate integration method.
Feature entry
Open embedded integration from the user menu
The entry is User Menu > Embedded Integration, with two navigation groups in the side bar:
- Embedded SDK: "Integration Guide" and "API Playground".
- **Message Rendering Component": "Integration Guide" and "API Playground".
Generate access code using the embed configuration console
"Embedded SDK > API Playground" includes "Current View", "Layout", "Style Examples", and "Content Parameters" on the left, a real environment preview in the "Embed Effect" section on the right, and a code area below. The code can be switched between ESM and CJS.
The wide-screen separator can be dragged or resized using arrow keys. Shift increases the movement amplitude, while Home/End moves it to the ends. In narrow-screen mode, they are arranged vertically in the order of configuration, preview effect, and code.
Open the integration guide
"Embedded SDK > Integration Guide" is organized according to the first-time access process:
- Preparation before access
- Select an authentication method
- Pass the token to the SDK
- Install and initialize the SDK
- React integration
- Integration for non-React projects
- Modify page styles
- Use AI coding tools to assist with integration
- API reference (including eight sections: initialization and authentication, component properties, instance methods, View parameters, layout parameters, events, error handling, and style customization)
The eighth section provides a button to download the Skill. The "Try It" button next to "View Parameters" in section 9 opens the Embed Configuration Console.
Relationship between the message rendering component and this module
The message rendering component is used to render individual DataPilot Agent messages in the host application. The client implements the input fields and session. Its "API Playground" demonstrates host business capabilities via switches and generates TSX configurations; complete instructions are provided on the corresponding page.
Detailed features
Select a view in the embed configuration console
Entry and role: Integration engineers or integration managers operate through User Menu > Embedded Integration > "Embedded SDK > API Playground" > "Current View" and must have permissions for the target resource.
Procedure:
- Select Complete Product, Engineer Workspace, Analyst Workspace, Semantic Processing, Intelligent Dialogue, or Build Artifact.
- Complete the resources in the "Content Parameters" displayed with the View; this field is not shown for Complete Product.
- After configuration, preview and load the corresponding interface, and the code is updated synchronously.
Views are single-selection enumeration. global has no parameters; engineer and analyst require Space, Agent is optional and "All Agents" is also available; semantic and chat require Space and Agent; buildArtifact also requires build artifacts. Parameters are case-sensitive non-empty IDs. If a required item is missing, the preview prompts you to complete the resource; switching Views restores the default layout of the new View.
Select resources to embed
Entry and conditions: After logging in, you can select spaces, agents, and build artifacts from the "Content Parameters" panel. The options are based on the resources accessible to your account. To use the Release Agent related views, you must also complete a subscription.
Procedure:
- Wait for the Playground to automatically load the resource directory.
- Select a space, then an agent; for Engineer and Analyst views, you can select "All Agents".
- For the Build Artifact view, you also need to select a specific build artifact.
- Once parameters are complete, preview and code update synchronously.
All three dropdowns are single-selection. Switching spaces clears agents and build artifacts; switching agents clears build artifacts. Loading is completed on the current page, without entering the task center or showing a percentage; the Build Artifact view additionally loads the artifact directory.
If "Unable to load embedded resources, please try again later." or "Unable to load build artifacts, please try again later." appears, you can reselect a view or reopen the modal. No available resources usually indicate the account lacks permissions, resources, or a subscription. The Engineer page uses the Developer Agent, while the Analyst, Dialogue, and Build Artifact pages use the Release Agent.
Trim side bar entries and top bar buttons on the embedded page
Entries: The switches for "Top Bar", "Logo", "Side Bar", and "Dialogue" in the "Layout" section, as well as the collapsed groups for "Top Bar Button", "User Menu", and "Side Bar Entry". When the parent level is turned off, the corresponding collapsed group is hidden.
Procedure:
- Set the overall switches for the four areas.
- Configure specific entries within the collapsed groups; "(N enabled)" displays the number of enabled items in real time.
- Preview and code update with the settings; the entire group can be restored to default.
Collapsed groups are displayed by default, with all switches inside them enabled by default; "N enabled" only indicates the status of the configuration panel. Personal email settings, password change, and logoff are always hidden. The side bar entry group only takes effect on Engineer-related pages; the Semantic Processing page only shows the Semantic Processing entry. Turning off the side bar only hides the configuration group, not clearing its settings; when all Engineer side bar entries are turned off, both the side bar and the restore entry disappear together.
Try sample styles and generate style code
"Style Sample" is disabled by default, providing two options: "Hide dialogue file download entry" and "Unified rounded corners". The former hides the file download button and link without changing server-side permissions; the latter sets the rounded corners for buttons, input fields, cards, and pop-ups to 12px. These two options can be enabled separately or together, with preview and code updating synchronously; "Restore Default" becomes available after either option is enabled.
The generated appearance includes both regional styles and selector rules. The download entry is only visible when the dialogue contains relevant content; regional rounded corners are not automatically applied to internal controls.
Verify embedded configurations in real-time preview
Prerequisites: A view has been selected, required resource parameters are complete, and the login session is valid.
During preview loading, a mask, spinning icon, and "Embedding..." are displayed; upon completion, the actual DataPilot is shown. Subsequent configuration updates occur within the same container. Layout or style updates retain unsent content and the state of the side bar; switching views or resources enters a new context.
Loading is completed on the current page, without entering the task center or showing a percentage. End states include the embedded page, empty parameter or session states, and the error panel. UPDATE_TIMEOUT indicates the update was not confirmed within 15 seconds; you can adjust the configuration or reopen the modal. If failures persist, check the relationship between the agent and space, account permissions, and the versions of the view and agent. Preview operations directly affect real data; use test resources for verification.
How to confirm configuration changes take effect
After modifying a view, resource, layout, or style, the preview reverts to the loading state; once loading completes and the corresponding fields in the code are updated, the configuration takes effect. Layout and style updates retain the current session and unsent input; switching resources or views creates a new page context. If the update fails, an error panel and error code, such as UPDATE_TIMEOUT, are displayed; you can rebuild by switching views or reopening the modal.
The ticket address and platform address in the code are example values; replace them with the host backend API and the current instance address during integration.
Download page to integrate skill access
Entry and conditions: Integrating engineers use the download button in Section 8 of the "Embedded SDK > Integration Guide"; a coding tool that supports Agent Skills must be installed locally. This step is optional.
Procedure:
- Click Download DataPilot page embed access Skill 0.1.1 to obtain the compressed package.
- After decompressing it, run
npx skills add <decompression directory>/datapilot-visual-embed-integrator. - Specify the target page, login module, and layout requirements to the code generation tool, and have the tool confirm the platform address and workspace ID.
- Verify the generated code for views, resources, and layout.
Skill only assists in generating code and does not participate in page runtime or replace the console for validation. If installation fails, check the decompression path and tool compatibility. If the generated result does not meet requirements, clearly define the views, hidden areas, and the location of the existing login module. When upgrading the SDK, use a Skill of the matching version.
Typical process
Process 1: embed from scratch on the zhichengtong page
- Prepare the platform URL and an account with permissions for the target resource. In cross-domain scenarios, have the administrator register the website origin.
- On User menu > Embedded integration > Access guide, determine the login method and prepare the Token ticket-taking interface.
- Install and initialize the SDK according to the React or non-React guidelines. First, verify with the 「Full product」
globalversion. - In the API playground, select the target View, workspace, Agent, or build artifact, set the layout, and preview it.
- Copy the code configuration. If a coding tool is required, download and install the access Skill.
Process 2: embed only the dialog of a specific agent
- In the API playground, select 「Smart Dialog」.
- Select a workspace and the Subscribed Agent within that workspace.
- Hide areas such as the top bar as needed. By default, this View hides the top bar, Logo, and side panel.
- Verify the dialog in the real preview, copy the code, and implement the ticket-taking logic for business callbacks such as file preview and download.
Process 3: adjust the appearance of the embedded page
- In the API playground, enable 「Unified rounded corners」 and 「Hide dialog file download entry」 to view the real preview.
- Copy the style configuration and pass it as
appearance. Use selectors for fine-grained control. - Click 「Restore defaults」 to clear the sample styles in the configuration console.
Process 4: safely apply configuration changes online
- Use test resources to verify the View, resources, layout, and style.
- Replace the ticket-taking address and platform URL in the code.
- Layout and style updates take effect in the current container while preserving the page state. Resource updates enter a new context and do not retain drafts of other resources.
- Destroy the embedded instance when the website logs out. Issued platform credentials are not automatically revoked.
