What this Skill does
Helps integrator developers correctly integrate the DJI Cloud API 2 skeleton/web(Vue 3 + Vite + TypeScript) project or standalone HTML page Correctly integrate DJI Cloud API 2 in 7 major components, and accurately handle key details such as initialization, authentication, destruction, and cross-origin.
Overview of the 7 major components
| Component | SDK global name | Depends on paas.js | Purpose |
|---|---|---|---|
| Wayline editing | window.WaylineEditor |
❌ Self-contained | Wayline creation / editing / merging |
| Wayline preview | window.WaylineView |
❌ Self-contained | Read-only wayline preview (multiple waylines rendered simultaneously) |
| Device management | window.UranusDeviceManagerApp |
❌ Self-contained | Device list, status, management |
| Cockpit | window.FH2.loadCockpit |
✅ Requires paas.js | Real-time video live streaming + flight control |
| Flight records | window.FlyDataReplay |
❌ Self-contained | Flight track playback and analysis |
| Live streaming wall | window.DJILivePlayer |
❌ Fully independent | Multi-channel live streaming grid display |
| Device mini window | window.FH2.loadDeviceWindow |
✅ Requires paas.js | Floating device live streaming mini window |
When to trigger
- The user wants to "integrate / embed / incorporate" any DJI Cloud API 2 / FH2 / paas.js component
- The user mentions FH2-related files in skeleton/web (
useFH2、ensureFH2Init、CockpitView、WaylineView、useSDKLoader) - The user asks about the usage of
WaylineEditor/WaylineView/FlyDataReplay/UranusDeviceManagerApp/DJILivePlayer/FH2.loadCockpit/FH2.loadDevice/FH2.loadDeviceWindowusage - The user asks about loading
initConfig/frontHost/serverHost/wssHost/paas.jsLoad - The user asks about showing/hiding the / cockpit module
cockpitConfig/setCockpitConfig/ cockpit module show/hide - The user asks about modular mounting of the / device management module
setupDeviceManager/mountDeviceList/ device management modular mounting - The user asks about wayline merging
concatWayline/ wayline stitching - The user asks about SDK error codes (4001/4002/5000/5001/6000/6001/6002/6003/7000)
- The user asks about theme customization /
setTheme/setCockpitTheme/ theme tokens - The user asks about device topology /
showDeviceTopo/map.topo - The user asks about cross-origin / Mixed Content / Whistle proxy / local debugging
Do not trigger: general frontend questions (React/Vue/Webpack and the like), DJI Mobile SDK, other SDKs that are not FH2.
Workflow
This Skill follows the 7-chapter SOP defined in skills/_shared/sop-template.md .
It automatically selects the execution depth (L1/L2/L3) based on the user's request.
Step 1: Identify the component + determine the scenario
IF 用户在 skeleton/web 项目中工作 → Vue 集成模式
ELIF 用户需要独立 HTML 页面 → 独立 HTML 模式
ELSE → 先问清楚
Vue integration mode: Refer to references/skeleton-integration.mdand use the existing composable pattern.
Standalone HTML mode: Refer to snippets/standalone-html-template.html + each component reference, and output complete HTML.
Step 2: Collect environment information
Figure out the 3 addresses (all required, except for self-contained SDKs):
| Information | Example | Description |
|---|---|---|
frontHost |
http://<your-server> |
Frontend service address, able to access /paas.js and SDK resources |
serverHost |
http://<your-server>:30812 |
Backend API address (generally frontHost + :30812) |
wssHost |
ws://<your-server>:30812/... |
WebSocket address |
Self-contained SDK(WaylineEditor / WaylineView / FlyDataReplay / DeviceManager / DJILivePlayer) does not need paas.js, but still needs serverHost(api.baseUrl) and wssHost(ws.url)。
If the user did not provide it, ask first.Do not make up IP / port / token。
In Vue mode these are configured through .env environment variables (VITE_FH2_ADDRESS / VITE_FH2_PORT), see useFH2Config.ts。
Step 3: Read the references of the corresponding component
- Wayline editing (create/edit/stitch) →
references/wayline-editor.md - Wayline preview (read-only rendering) →
references/wayline-view.md - Device management →
references/device-manager.md - Cockpit →
references/cockpit.md - Flight record replay →
references/fly-data-replay.md - Live streaming big screen →
references/multi-stream.md - Device mini window →
references/device-window.md - Theme customization →
references/theme.md - Device topology (
showDeviceTopo/map.topo) → Refer to the reference of the currently used component (wayline-editor.mdSection 8 /wayline-view.md/fly-data-replay.mdSection 10) - 7-component initialization parameter comparison →
references/api-overview.md - skeleton/web integration architecture →
references/skeleton-integration.md - Troubleshooting →
references/troubleshooting.md
Step 4: Output code + annotate mandatory constraints
When outputting code, the following reminders must be included ( critical level in constraints.yaml):
- Protocol consistency: HTTPS pages must use
https://+wss://, HTTP useshttp://+ws:// - Load order: Components that depend on paas.js (cockpit / device mini window) must have
paas.jsbeforeinitConfig,initConfigbeforeloadXxx - Self-contained SDK independence: WaylineEditor / WaylineView / FlyDataReplay / DeviceManager / DJILivePlayer do not need
paas.js, and do not callinitConfig - Container size: DOM containers must have explicit width and height
- Destruction timing: Before switching pages/routes, you must
destroy()the old instance - DOM structure must not be modified: Components that depend on paas.js require specific DOM IDs and class name structure
- Single instance recommended: Only mount one WaylineEditor or FlyDataReplay per page (they are page-level fixed mount points, and multiple instances overwrite each other; to switch waylines/tasks use
destroy()then rebuild). DJILivePlayer is the exception, as it is meant for multiple instances in a grid - hostUrl is still required: The
hostUrlfield of WaylineEditor / FlyDataReplay is not a deprecated field; it is a required (non-optional) field and must be passed the frontend service address;runtimeDepsBasePath+map.env.cesiumBaseUrlis an additionally added dependency resource path configuration, passed together withhostUrl, not a replacement relationship; do not deletehostUrl - Cesium synchronous loading: Self-contained SDKs (WaylineEditor / WaylineView / FlyDataReplay) must load Cesium.js synchronously first
Step 5: Troubleshoot problems
When errors or abnormal behavior occur, check references/troubleshooting.md(error code table + common pitfalls + Whistle debugging).
Core constraints (critical level, must not be violated)
See constraints.yaml; all rules in level: critical must be satisfied when generating code.
Vue integration pattern key points
Standard steps for adding a new FH2 component page in skeleton/web:
- In
src/views/create a new View component - Use
ensureFH2Init()to ensure FH2 initialization (only for components depending on paas.js) - Call
FH2.loadXxx(containerId, options)ornew XxxSDK(options)to mount - In
onUnmountedexecutedestroy()+ unsubscribe events - In
src/router/register the route
See references/skeleton-integration.md。
Authoritative reference
references/ The content under is the complete guide for integrating the 7 major components of DJI Cloud API 2 by integrators.
snippets/ Under there are Vue component templates and standalone HTML templates for reference.
commands/ Under there are 6 shortcut commands that can be called directly.
The constraints.yaml of this Skill contains only frontend-domain-specific rules; for general SDK constraints see
skills/_shared/constraints-common.yaml(must also be followed when generating code). For cross-Skill routing rules seeskills/_shared/skill-routing.md. When the user's intent is found to fall under the responsibility of another Skill, switch according to the handover protocol. For output format seeskills/_shared/output-format.md. References are lazily loaded on demand; do not read all references/ at once.