App Versions

App Versions let you manage software releases, detect outdated clients, enforce mandatory updates, and verify file integrity.

Version Properties

Each version has:

FieldTypeDescription
versionstringVersion identifier (e.g., "2.1.0")
changelogstringRelease notes (up to 5000 chars)
fileHashesobjectMap of filename to expected hash for integrity checks
downloadUrlstringURL where the update can be downloaded
forceUpdatebooleanWhether this update is mandatory
currentbooleanWhether this is the current/latest version

Managing Versions (Dashboard API)

List Versions

GET /v1/dashboard/app-versions/products/:productId

Create a Version

await fetch('/v1/dashboard/app-versions/products/PRODUCT_ID', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    version: '2.1.0',
    changelog: 'Bug fixes and performance improvements',
    downloadUrl: 'https://releases.example.com/v2.1.0/setup.exe',
    fileHashes: {
      'app.exe': 'sha256-abc123...',
      'data.dll': 'sha256-def456...'
    },
    forceUpdate: false,
    current: true    // Sets this as the current version
  })
});

Setting current: true automatically unsets the previous current version.

Update a Version

PATCH /v1/dashboard/app-versions/products/:productId/:versionId

Update any fields — changelog, downloadUrl, fileHashes, forceUpdate, or current.

Delete a Version

DELETE /v1/dashboard/app-versions/products/:productId/:versionId

Checking for Updates (Client API)

Your application checks for updates using the public endpoint (requires version:read permission):

const response = await fetch('https://api.geckoguard.com/v1/app-versions/check-update', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    productId: 'your-product-id',
    currentVersion: '2.0.0',
    fileHashes: {                        // Optional: for integrity checking
      'app.exe': 'sha256-current...',
      'data.dll': 'sha256-current...'
    }
  })
});

const { data } = await response.json();

Response

{
  "ok": true,
  "data": {
    "updateAvailable": true,
    "forceUpdate": false,
    "currentVersion": "2.0.0",
    "latestVersion": "2.1.0",
    "changelog": "Bug fixes and performance improvements",
    "downloadUrl": "https://releases.example.com/v2.1.0/setup.exe",
    "integrityOk": true
  }
}

Integrity Checking

If you pass fileHashes in the request, GeckoGuard compares them against the expected hashes for the current version. If any file's hash doesn't match:

{
  "integrityOk": false,
  "integrityErrors": ["app.exe"]
}

This detects tampered or corrupted files — useful for anti-cheat or security-sensitive applications.

Typical Workflow

  1. Build your application release
  2. Calculate file hashes (SHA-256)
  3. Create a new version via the API or dashboard with current: true
  4. Your application calls check-update on launch
  5. If updateAvailable is true, prompt the user (or force if forceUpdate is true)
  6. If integrityOk is false, warn or block execution

Force Updates

Set forceUpdate: true on a version to indicate it's mandatory. Your application should check this flag and prevent usage until the user updates. Useful for:

  • Security patches
  • Breaking API changes
  • Anti-cheat updates