@dronedeploy/rocos-js-sdk

中文文档
4.5.1发布于 2026/11/11UNLICENSEDTypeScriptESM + CJS近 30 天下载 2176

Javascript SDK for rocos

原始使用文档
文档目录44 节
  1. Using with Node
  2. Installation
  3. What's new
  4. 4.0.0
  5. 3.1.2
  6. 3.1.1
  7. 3.1.0
  8. 3.0.30
  9. 3.0.29
  10. 3.0.28
  11. 3.0.27
  12. 3.0.25
  13. 3.0.23
  14. 3.0.21
  15. 3.0.20
  16. 3.0.19
  17. 3.0.18
  18. 3.0.17
  19. 3.0.16
  20. 3.0.15
  21. 3.0.14
  22. 3.0.13
  23. 3.0.11
  24. 3.0.10
  25. 3.0.9
  26. 3.0.8
  27. 3.0.7
  28. 3.0.6
  29. 3.0.5
  30. 3.0.4
  31. 3.0.3
  32. 3.0.2
  33. 3.0.1
  34. 2.6.1
  35. 2.6.0
  36. 2.4.0
  37. 2.3.0
  38. 2.2.0
  39. 2.1.0
  40. 2.0.2
  41. 2.0.1
  42. 2.0.0
  43. 1.19.0
  44. 1.18.0

rocos-js-sdk

Javascript SDK for interacting with the Rocos platform.

Using with Node

In order to use the SDK with node, you must be using node version 18.13 or higher.

Installation

Install the package with npm

npm install @dronedeploy/rocos-js-sdk

or yarn

yarn add @dronedeploy/rocos-js-sdk rxjs@^7

What's new

4.0.0

  • BREAKING: The default telemetry transport is now 'connect' (the Connect protocol) instead of 'grpc-web'. Consumers that do not set transport explicitly will switch to Connect automatically. If your backend or proxy only supports gRPC-web, restore the previous behaviour with transport: 'grpc-web'.
  • The 'grpc-web' telemetry transport is deprecated and will be removed in a future release. Selecting it now logs a one-time deprecation warning.

3.1.2

  • Use the optional fetch implementation for the gRPC-web transport too, so a custom fetch can be supplied consistently across transports.

3.1.1

  • Allow an optional fetch implementation to be supplied to the Connect transport.

3.1.0

  • Add a Connect-RPC telemetry transport variant.
  • Upgrade connectrpc and bufbuild to the latest versions and move to TypeScript 6.
  • Prune unused and trivially-replaceable dependencies.

3.0.30

  • MapService
    • Add a create API and fix the copy API.

3.0.29

  • Add new APIs for setting map content and metadata.

3.0.28

  • Add base_floor_plan to Level.

3.0.27

  • Add staticAttributes field to AssetSyncDefinitionModel.

3.0.25

  • IntegrationService
    • Add getLevels method.

3.0.23

  • Add metadata field to device credentials.

3.0.21

  • Export types for device credentials.

3.0.20

  • Add library list/import endpoints.

3.0.19

  • CallerService
    • Add a cancel observable to service calls.

3.0.18

  • CallerService
    • Add a rawPayload option to service calls.

3.0.17

  • RobotService
    • List robots by account/org.

3.0.16

  • Add missing types for EventService and ProfileService.

3.0.15

  • ProfileService
    • Change the profile export type to Blob.

3.0.14

  • Utils
    • Expose splitRobotTopic.

3.0.13

  • kscript
    • Additional support for custom widgets.

3.0.11

  • Improve the accuracy of file sync types.

3.0.10

  • MapService
    • Add a system parameter to the list maps endpoint.

3.0.9

  • WorkflowService
    • Add methods for importing/exporting workflows.

3.0.8

  • Add an HTTP listener/hook.

3.0.7

  • MapService
    • Add lastModifiedTimestamp to list maps.

3.0.6

  • WorkflowService
    • Add a function to delete an asset.

3.0.5

  • Add name to the Locations type.

3.0.4

  • Panorama
    • Allow any type on the data prop.

3.0.3

  • MapService
    • Add a hash property to the cloud map object.

3.0.2

  • Add a delete assets endpoint.

3.0.1

Breaking Changes

  • Change the protobuf generation to use the protobuf-ts package instead of protobuf-javascript.
    • No longer uses @improbable-eng/grpc-web implementation of the gRPC-web client.
  • CallerService
    • change CallerService.invokeRequest responses to be UTF-8 encoded UInt8Arrays instead of base64 encoded strings.
    • change array field names to remove the List suffix.
      • IRocosCallerMessageResponses.responsesList -> IRocosCallerMessageResponses.responses
      • IRocosCallerMessageChunks.rowsList -> IRocosCallerMessageChunks.rows
    • split IRocosCallerMessageResponseReturn.header.created field into createdAt and createdNs fields
      • createdAt is a Date object representing the time the message was created, with millisecond precision.
      • createdNs is a string representing the time the message was created, with nanosecond precision. You can use this with the BigInt constructor to get a BigInt representation of the time.
  • RTPWebRTCService
    • refactor the following functions to return a promise, rather than using a callback:
      • WebRTCSignallingStream.offerConnection()
      • WebRTCSignallingStream.getDetails()
      • WebRTCSignallingStream.addIceCandidate()
    • split the stream interface IWebRTCSignallingResponseStream.on(type, handler) into onMessage(handler), onError(handler), and onComplete(handler).
  • MapService
    • Removed initDB method
    • Changed copyFromRobot method to sendToCloud
    • changed copyFromCloud method to copy
  • FileAccessorService
    • Removed uploadFile method
  • AuthService
    • Removed the ability to login with a username and password. Only api keys or tokens are supported now.
    • Tokens are now checked for validity before being used
    • IToken interface changes
      • created is now issuedAt and is a Date object instead of a string
      • expiresIn is now expires and is a Date object instead of a number
  • Logging in and signing up with email and password has been removed
  • Resetting password has been removed
  • WorkflowService
    • Renamed getDeployedOnRobot to getDeployedWorkflow
    • Renamed listDeployedOnRobot to list
  • Utils
    • Removed generateUUID method
    • Refactor Token class
      • expiresIn: number -> expires?: Date
      • created: string -> issuedAt?: Date
    • Removed unused math utility functions

Removed

  • Breaking: remove FileAccessorService.uploadFile
  • Breaking: remove the ability to authenticate using a username and password. Only API keys and tokens are supported now.
  • Breaking: remove unused math utility functions

Fixed

  • Remove Node 18 engine requirement to allow building for web targets on previous Node versions. Node 18 is still required to run the SDK in Node.

2.6.1

  • Modify map service response type

2.6.0

  • Change rxjs dependency to a peer dependency (support for ^6.6.6 || ^7.0.0)
    • If you are using yarn you may need to add rxjs to your dependencies

2.4.0

  • deleted unused endpoints relating to legacy accounts which are no longer supported

2.3.0

  • Added mapService for supporting agent map functionality

2.2.0

  • Added listUsers method in ProjectService to list project users
  • Added additional debug information for failed HTTP responses

2.1.0

  • Added getPlansPaged method to the IntegrationService to retrieve plans in a paged manner

2.0.2

  • Fix no-content responses attempting to parse as JSON

2.0.1

  • Security updates for React demo app dependencies

2.0.0

  • Updating base class for all REST requests to go via fetch instead of axios
  • Remove unused dependencies source-map-loader, ts-loader, axios
  • Mark certain auth methods as deprecated in AuthService
    • login Login with email and password.
    • signup
    • resetPassword
  • Deleted legacy services, these services are prefixed with BC, e.g. BCRocosClient
  • Updated outdated dependencies in the Angular demo application

Migrating from 1.x to 2.x

  • NodeJS engine requirements need to be v18.13 and npm v8 to use in NodeJS as the underlying HTTP services now use fetch API
  • Legacy services prefixed with BC will need to be migrated to use the standard services

1.19.0

New method added to the IntegrationService to create a new issue in the current location.

  • createIssue - Creates a new issue in a specific location on the latest map plan

1.18.0

Added new integration service to be able to retrieve plans created in DroneDeploy

This can be retrieved by getIntegrationService(). Available methods:

  • getPlans - Gets a list of plans
  • getPlanById - Retrieves a specific plan with the tiled layer that can be used to render meshes, point clouds, or tiled maps
  • getWMTS - Returns WMTS tiles that can be rendered in tools such as mapbox if your project has WMTS feature enabled)

版本与发布记录

@dronedeploy/rocos-js-sdk 共发布 113 个版本,首次发布于 2023/08/22;过去 12 个月发布了 44 个版本。

版本发布日期距今
4.5.1latest2026/11/112 天前
4.5.02026/11/103 天前
4.4.16-rc.1next2026/11/0310 天前
4.4.152026/11/0211 天前
4.4.142026/10/2816 天前
4.4.132026/10/2024 天前

关于 @dronedeploy/rocos-js-sdk 的常见问题

@dronedeploy/rocos-js-sdk 是什么?

Javascript SDK for rocos

如何安装 @dronedeploy/rocos-js-sdk?

在项目目录运行 npm install @dronedeploy/rocos-js-sdk,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:rxjs(^6.6.6 || ^7.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@dronedeploy/rocos-js-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dronedeploy/rocos-js-sdk 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@dronedeploy/rocos-js-sdk 可以商用吗?

@dronedeploy/rocos-js-sdk 使用 UNLICENSED 许可。作者声明为 UNLICENSED,即不授予公开使用许可(与公共领域的 Unlicense 不同)。使用前需获得作者授权。以上为概括,不构成法律意见,请以许可原文为准。

@dronedeploy/rocos-js-sdk 的下载量有多少?

根据 npm 官方下载统计,@dronedeploy/rocos-js-sdk 在 2026/10/13 – 2026/11/11 这 30 天内被下载 2,176 次,日均约 73 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dronedeploy/rocos-js-sdk 还在维护吗?

最新版本 4.5.1 发布于 2026/11/11(2 天前);至今共发布 113 个版本,其中过去 12 个月发布了 44 个;首次发布于 2023/08/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。