Basic Game Setup

Set up Network Storage in your s&box game from scratch. Install the library, create a project, configure collections, and implement basic data operations.

YAML Source is the Network Storage authoring standard.
Use the s&box Library Manager install for auto-updates. GitHub is best for agents, source review, contributions, and manual installs.
4

Sync with Network Storage

The Sync Tool lets you manage collections, endpoints, workflows, and game values directly from the s&box editor. Push local changes to the server or pull the latest server state down.

YAML Source is the standard for new synced resources. Prefer `.yml` filenames for new YAML Source files. `.yaml` remains accepted and is treated the same. Use YAML Source for new synced definitions.

## Open the Sync Tool

In the s&box editor menu bar, click **Network Storage > Sync Tool**:

![Sync Tool](https://cdn.sboxcool.com/uploads/wiki/sync-tool.webp)

If you already configured credentials in **Network Storage > Setup**, the Sync Tool connects automatically.

The Sync Tool uses all three project identifiers together:

- **Project ID** selects which project to sync
- **Public Key** identifies the runtime project that owns the data
- **Secret Key** authorizes the Management API changes

Only the Secret Key is editor-only. It is never exported with published game files.

## Push and Pull

The Sync Tool works with the files in your `Editor/Network Storage/` folder:

| Folder | Contents | Push | Pull |
|--------|----------|------|------|
| `collections/` | Collection YAML Source files | Creates/updates collections on server | Downloads current schemas from server |
| `endpoints/` | Endpoint YAML Source files | Creates/updates endpoints on server | Downloads current endpoints from server |
| `workflows/` | Workflow YAML Source files | Creates/updates workflows on server | Downloads current workflows from server |

### Push (Local to Server)

1. Edit your YAML Source files in `Editor/Network Storage/`
2. Open **Network Storage > Sync Tool**
3. Click **Push**

The tool sends your local definitions to the server. If there are conflicts (e.g., schema changes that affect existing data), you will see a diff showing what will change.

### Pull (Server to Local)

1. Open **Network Storage > Sync Tool**
2. Click **Pull**

The tool downloads the current state from the server and saves it to your local files. This is useful when you have made changes on the dashboard and want your local files to match.

## Game Values

Game Values are server-authoritative constants your endpoints use. Define them on the dashboard:

1. Open your project on the [Network Storage dashboard](/tools/network-storage)
2. Go to the **Game Values** tab
3. Create groups with key-value pairs:

| Group | Key | Value |
|-------|-----|-------|
| `combat` | `xp_per_kill` | `50` |
| `combat` | `gold_per_kill` | `25` |

Your endpoints reference these as `{{values.combat.xp_per_kill}}`. Change them on the dashboard at any time without updating game code.

## File Structure

After setup and first sync, your project folder looks like:

```
Editor/Network Storage/
config/
public/projectConfig.json (Project ID + public key, safe to commit)
secret/secret_key.json (Secret Key only, gitignored)
collections/
players.collection.yml
endpoints/
init-player.endpoint.yml
workflows/
validate-purchase.workflow.yml
```
Tips & Troubleshooting

> **Troubleshooting:** If the Sync Tool shows "Connection Failed", open **Network Storage > Setup** and click **Test Connection** to verify your credentials. Make sure your Project ID, public key, and secret key are all entered correctly.