Main SDK package for building Decentraland scenes.
npm install @dcl/sdkMain SDK package for building Decentraland scenes.
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
``bash`
npm install @dcl/sdk
1. Create a new scene:
`bash`
npx @dcl/sdk-commands init
2. Start the development server:
`bash`
npm start
`typescript
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'
})
`
- Transform
- GltfContainer
- Material
- UiTransform
- AudioSource
- And many more...
- Input handling
- Physics
- Animation
- Networking
- Flexbox layout
- React-like components
- Event handling
`bash`
make build
`bash`Run all tests
make test
For local development, you can also use:
`bashClean all build artifacts and reinstall dependencies
make clean && make install
- SDK Documentation
- Scene Examples
- ECS
For a deeper understanding of the SDK architecture:
- ADR-117: CRDT Protocol for Scenes
- ADR-123: Schema and Serialization
- ADR-165: Component Declaration