mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-30 04:49:32 -04:00
Replaces the Mintlify setup (mint.json, docs.json, snippets) with a standalone Fumadocs app in docs/: Next.js app router, meta.json nav per section, its own bun install. Run with `just dev-docs`. Content pass alongside the migration: core architecture, data model, CLI, and networking pages rewritten around the daemon/source-store/ library split, new product-direction.mdx defining the product boundary, new drive-catalog plan, and the physical-drives plan updated to reference it. Whitepaper page retired.
89 lines
2.2 KiB
Plaintext
89 lines
2.2 KiB
Plaintext
---
|
|
title: Getting Started
|
|
description: Build and load a sandboxed Spacedrive extension
|
|
sidebarTitle: Getting Started
|
|
---
|
|
|
|
Spacedrive extensions are Rust crates compiled to WebAssembly. The SDK provides
|
|
macros and host bindings for models, jobs, actions, file kinds, previews, and
|
|
interface contributions.
|
|
|
|
## Prerequisites
|
|
|
|
- the Rust toolchain used by the repository;
|
|
- the WebAssembly target;
|
|
- a Spacedrive 2.0 development build.
|
|
|
|
~~~bash
|
|
rustup target add wasm32-unknown-unknown
|
|
~~~
|
|
|
|
## Start from the example
|
|
|
|
The repository includes **extensions/test-extension** as a working package.
|
|
Copy its crate structure and change the extension identity.
|
|
|
|
A minimal definition looks like:
|
|
|
|
~~~rust
|
|
use spacedrive_sdk::prelude::*;
|
|
|
|
#[extension(
|
|
id = "com.example.notes",
|
|
name = "Notes",
|
|
version = "0.1.0",
|
|
jobs = [index_notes],
|
|
)]
|
|
struct NotesExtension;
|
|
~~~
|
|
|
|
Extension IDs are durable identity. Use a reverse-domain name you control and
|
|
do not reuse an ID for unrelated software.
|
|
|
|
## Build
|
|
|
|
From the extension directory:
|
|
|
|
~~~bash
|
|
cargo build --target wasm32-unknown-unknown --release
|
|
~~~
|
|
|
|
The compiled module appears under:
|
|
|
|
~~~text
|
|
target/wasm32-unknown-unknown/release/
|
|
~~~
|
|
|
|
Package the WASM module with its manifest, signature, assets, and declarative UI
|
|
files.
|
|
|
|
## Install locally
|
|
|
|
Open **Settings > Extensions**, choose **Install from file**, and select the
|
|
package. Review every requested capability before enabling it.
|
|
|
|
During development, reinstall after changing the WASM module or manifest.
|
|
Spacedrive preserves extension-owned durable data unless the uninstall preview
|
|
explicitly includes it.
|
|
|
|
## Add one capability at a time
|
|
|
|
A good first extension:
|
|
|
|
1. declares one file kind;
|
|
2. reads one granted source scope;
|
|
3. runs one deterministic job;
|
|
4. writes one typed model or sidecar;
|
|
5. contributes one preview or inspector section;
|
|
6. reports progress and failure through the host API.
|
|
|
|
This exercises identity, permissions, durability, and interface integration
|
|
without hiding several failures in one workflow.
|
|
|
|
## Continue
|
|
|
|
- [Core Concepts](/extensions/core-concepts)
|
|
- [Data Storage](/extensions/data-storage)
|
|
- [Security and Sync](/extensions/security-and-sync)
|
|
- [UI Integration](/extensions/ui-integration)
|