@dcl/sdk

中文文档
7.33.0发布于 2026/11/06Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 1.2万

Main SDK package for building Decentraland scenes.

原始使用文档
文档目录14 节
  1. Overview
  2. Installation
  3. Quick Start
  4. Usage
  5. Features
  6. Components
  7. Systems
  8. UI Framework
  9. Development
  10. Building the Package
  11. Testing
  12. Development Commands
  13. Documentation
  14. Architecture Decisions

@dcl/sdk

Main SDK package for building Decentraland scenes.

Overview

The Decentraland SDK provides a complete framework for creating interactive 3D scenes in the Decentraland metaverse. It includes:

  • Entity Component System (ECS) for scene development
  • UI components and layout tools
  • Asset management utilities
  • Scene networking capabilities
  • Input handling and interactions

Installation

npm install @dcl/sdk

Quick Start

  1. Create a new scene:
npx @dcl/sdk-commands init
  1. Start the development server:
npm start

Usage

import { engine, Entity, Transform, GltfContainer } from '@dcl/sdk/ecs'

// Create an entity
const entity = engine.addEntity()

// Add components
Transform.create(entity, {
  position: { x: 8, y: 0, z: 8 },
  scale: { x: 1, y: 1, z: 1 }
})

GltfContainer.create(entity, {
  src: 'models/myModel.glb'
})

Features

Components

  • Transform
  • GltfContainer
  • Material
  • UiTransform
  • AudioSource
  • And many more...

Systems

  • Input handling
  • Physics
  • Animation
  • Networking

UI Framework

  • Flexbox layout
  • React-like components
  • Event handling

Development

Building the Package

make build

Testing

# Run all tests
make test

Development Commands

For local development, you can also use:

# Clean all build artifacts and reinstall dependencies
make clean && make install

# Format and fix linting issues
make lint-fix

# Update dependencies across packages
make sync-deps

Documentation

Architecture Decisions

For a deeper understanding of the SDK architecture:

版本与发布记录

@dcl/sdk 共发布 1,325 个版本,首次发布于 2022/06/21;过去 12 个月发布了 301 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
7.33.0latest2026/11/065 天前
7.32.1-42077145652.commit-f6053ef2026/11/066 天前
7.32.1-41691874543.commit-3063788auth-server2026/11/047 天前
7.31.1-41669733463.commit-b1b1d792026/11/048 天前
7.32.02026/11/048 天前
7.31.1-41508430758.commit-0af8af02026/11/038 天前

其他发布通道:ci → 7.8.16,protocol-squad → 7.25.1-30828532396.commit-0c215c3,experimental → 7.26.1-32979311771.commit-17041c9,experimental-bevy → 7.31.1-40604676255.commit-cb3ed84,experimental-bevy-auth-server → 7.31.1-40606969412.commit-24c05c3,auth-server → 7.32.1-41691874543.commit-3063788。

关于 @dcl/sdk 的常见问题

@dcl/sdk 是什么?

Main SDK package for building Decentraland scenes.

如何安装 @dcl/sdk?

在项目目录运行 npm install @dcl/sdk,或使用 pnpm add / yarn add / bun add。

@dcl/sdk 支持 TypeScript 吗?

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

@dcl/sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@dcl/sdk 可以商用吗?

@dcl/sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@dcl/sdk 的下载量有多少?

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

@dcl/sdk 还在维护吗?

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