Skip to content
exwave.Docs

Get started with Asset Storage

In this guide, you turn on Asset Storage, upload a file that every player can download, and download it as a player. Then you let each player keep their own save files. It takes about 15 minutes.

You need:

  • Access to the Asset Storage private beta. If you don’t have it yet, ask for it on the waitlist page.
  • A platform in Nexus. You must be an owner or an admin of its organization.
  • Auth turned on for the platform, and a player access token (PAT) for a signed-in player. To get one, see Games & player access tokens.
  • A terminal with curl. The examples use it so that you can try each request before you write it in your game or backend.
  1. Open Asset Storage.

    In Nexus, open your platform and go to Asset Storage. Select Turn on Asset Storage.

  2. Choose a location.

    Your files can’t be moved to another location yet, so choose carefully. Choose France (OVHcloud, Gravelines) or European Union (Cloudflare, in EU data centres). Then select Turn on in France or Turn on in the European Union.

    You should see Your storage, at a glance, with the storage you use and your plan’s allowance.

  3. Copy your platform ID and the Asset Storage URL.

    Under Reach your files, copy the Platform ID. The examples there start with the Asset Storage URL: copy the part before /v1/.

  1. Add an access rule.

    Go to Asset Storage → Access rules and select New rule. Under Start from a template, choose Game content. Its pattern is public/**, and Every player can download.

    Under In one sentence, Nexus should say “Every player can download files under public/. Only your backend uploads.” Select Create rule.

  2. Create an API key.

    In your organization, go to API Keys and select Create API key. Give the key a name. Under Permissions, check Read and Write for Assets. Select Create API key, then copy the key. It starts with exn_, and Nexus shows it only once.

  3. Save your values in the terminal.

    Replace the placeholders with your values:

    Terminal window
    export ASSETS_URL="<Asset Storage URL>"
    export PLATFORM_ID="<platform ID>"
    export API_KEY="exn_..."
  4. Create a test file.

    Terminal window
    printf 'Hello, world!' > hello.txt

    The file is 13 bytes long.

  5. Ask for an upload link.

    Give the path, the size in bytes and the content type:

    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/uploads" \
    -H "Authorization: Bearer $API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "path": "public/hello.txt", "content_length": 13, "content_type": "text/plain" }'

    Exwave reserves the space and answers with the link:

    {
    "upload_id": "0b6c2f0e-4f8e-4f4b-9a37-2f1c3d9e8a10",
    "path": "public/hello.txt",
    "method": "PUT",
    "url": "https://...",
    "headers": { "content-length": "13", "content-type": "text/plain" },
    "expires_at": "2026-11-25T14:30:00Z"
    }
  6. Send the file.

    Send the file to url with a PUT. Send the headers from the answer exactly as given, because they are part of the signature. curl adds Content-Length for you:

    Terminal window
    curl --fail -X PUT "<url from the answer>" \
    -H "Content-Type: text/plain" \
    --data-binary @hello.txt

    curl prints nothing when the upload works.

  7. Complete the upload.

    Use the upload_id from step 5:

    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/uploads/<upload_id>/complete" \
    -H "Authorization: Bearer $API_KEY"

    Exwave checks the file’s size and answers with the file:

    {
    "path": "public/hello.txt",
    "size": 13,
    "etag": "\"6cd3556deb0da54bca060b4c39479839\"",
    "content_type": "text/plain",
    "owner": null,
    "updated_at": "2026-11-25T14:16:02Z"
    }

    Until you complete the upload, no one can download the file. In Asset Storage → Files, you should now see hello.txt in the public folder.

Your game sends the player’s PAT instead of an API key. Asset Storage checks the token itself, then applies your access rules.

  1. Save the player’s token.

    Terminal window
    export PLAYER_TOKEN="<player access token>"

    A PAT lasts 15 minutes at most. If you get unauthorized, ask for a new one.

  2. Ask for a download link.

    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/downloads" \
    -H "Authorization: Bearer $PLAYER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{ "paths": ["public/hello.txt"] }'

    The answer has one entry for each path:

    {
    "files": [
    {
    "path": "public/hello.txt",
    "url": "https://...",
    "etag": "\"6cd3556deb0da54bca060b4c39479839\"",
    "size": 13,
    "content_type": "text/plain",
    "expires_at": "2026-11-25T14:31:40Z"
    }
    ]
    }
  3. Download the file.

    Terminal window
    curl "<url from the answer>"

    You should see Hello, world!.

Keep the etag with the file in your game. The etag changes when the file changes, so when it’s the same as last time, you can skip the download.

  1. Add the Save games rule.

    In Asset Storage → Access rules, select New rule and choose the Save games template. Its pattern is saves/{player}/**. Each player can download, upload and delete the files in their own folder. The template allows 10 MB per file, 20 files and 50 MB in total for each player. Change the limits if your saves need more, then select Create rule.

  2. Ask for an upload link as the player.

    Create a small save file:

    Terminal window
    printf 'level=3' > slot1.sav

    Then ask for a link with the player’s token. Write {player} where the player’s folder goes:

    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/uploads" \
    -H "Authorization: Bearer $PLAYER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{ "path": "saves/{player}/slot1.sav", "content_length": 7, "content_type": "application/octet-stream" }'

    In the answer, path shows the player’s real folder, such as saves/managed:283749102938475021/slot1.sav.

  3. Send the file and complete the upload.

    Terminal window
    curl --fail -X PUT "<url from the answer>" \
    -H "Content-Type: application/octet-stream" \
    --data-binary @slot1.sav
    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/uploads/<upload_id>/complete" \
    -H "Authorization: Bearer $PLAYER_TOKEN"

    The answer’s owner is the player’s ID. In Asset Storage → Files, enter that ID in Find a player’s files. You should see slot1.sav.

  4. Load the save.

    Terminal window
    curl -X POST "$ASSETS_URL/v1/platforms/$PLATFORM_ID/assets/downloads" \
    -H "Authorization: Bearer $PLAYER_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{ "paths": ["saves/{player}/slot1.sav"] }'

    Then download the url from the answer, as before.

To save again, upload to the same path: the new file replaces the old one. A player can’t write in another player’s folder. Asset Storage refuses with forbidden.