@8thwall/engine

中文文档
0.1.0发布于 2026/09/17MITCommonJS零依赖近 30 天下载 2691

Open Source framework for cross platform, browser based AR

原始使用文档
文档目录5 节
  1. Usage
  2. Option 1: Script tag
  3. Option 2: npm
  4. Overview
  5. SLAM Integration

8th Wall Engine

[!WARNING] This engine is released as a pre-release build. The API may change before the official 1.0.0 release.

Usage

See https://8thwall.org/docs/engine/overview for a more detailed guide.

Option 1: Script tag

<script src="https://cdn.jsdelivr.net/npm/@8thwall/[email protected]/dist/xr.js" async crossorigin="anonymous" data-preload-chunks="slam"></script>

[!NOTE] The XrController module in this package does not contain SLAM (World Tracking), only Image Targets. However, for backwards compatibility, the chunk name is still slam. See "SLAM Integration" below for more details.

Option 2: npm

npm install @8thwall/engine

You will need to copy the included artifacts into your dist folder, for example in webpack:

new CopyWebpackPlugin({
  patterns: [
    {
      from: 'node_modules/@8thwall/engine/dist',
      to: 'external/xr',
    }
  ]
})

You can then load the SDK by adding the following to index.html:

<script src="./external/xr/xr.js" data-preload-chunks="slam" async></script>

When importing the package, you will get a simple helper for accessing XR8 once it is loaded. This promise will only resolve if the script tag is included in the HTML.

import {XR8Promise} from '@8thwall/engine'

XR8Promise.then((XR8) => XR8.XrController.configure({}))

Overview

The 8th Wall open-source engine includes:

  • Core engine architecture
  • Image Targets
  • Face Effects
  • Sky Effects

It does not include:

  • Niantic Spatial products such as VPS, Lightship Maps, or the Geospatial Browser
  • Hand Tracking

SLAM Integration

The open-source engine does not contain a SLAM module. However, there is an option to load the SLAM module provided by the Distributed Engine Binary into the open-source engine.

[!NOTE] The Distributed Engine Binary is available through a limited-use license which places restrictions on how it can be used. The full license text is here. Please see the Permitted Use FAQ and Attribution Guidelines for more information.

In the below code, the data-preload-chunks="slam: <url>" instructs the open-source engine to fetch the slam chunk from that given URL. The same XrController API will be available. XR8.loadChunks({name: 'slam', url: '<url>'}) is also supported.

<script async crossorigin="anonymous"
  src="https://cdn.jsdelivr.net/npm/@8thwall/[email protected]/dist/xr.js"
  data-preload-chunks="slam: https://cdn.jsdelivr.net/npm/@8thwall/engine-binary@1/dist/xr-slam.js"
></script>

If using npm, run:

npm install @8thwall/engine-binary

Add the following, or equivalent to your build configuration:

new CopyWebpackPlugin({
  patterns: [
    {
      from: 'node_modules/@8thwall/engine-binary/dist',
      to: 'external/xr-binary', // NOTE: Copied to a different path than @8thwall/engine
    }
  ]
})

Then specify the relative URL:

<script async
  src="./external/xr/xr.js"
  data-preload-chunks="slam: ./external/xr-binary/xr-slam.js"
></script>

版本与发布记录

@8thwall/engine 共发布 1 个版本,首次发布于 2026/09/17;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.1.0latest2026/09/171 个月前

关于 @8thwall/engine 的常见问题

@8thwall/engine 是什么?

Open Source framework for cross platform, browser based AR

如何安装 @8thwall/engine?

在项目目录运行 npm install @8thwall/engine,或使用 pnpm add / yarn add / bun add。

@8thwall/engine 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/8thwall__engine 是否存在。

@8thwall/engine 支持 ESM 还是 CommonJS?

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

@8thwall/engine 可以商用吗?

@8thwall/engine 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@8thwall/engine 的下载量有多少?

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

@8thwall/engine 还在维护吗?

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