Skip to content

Configuration

Everything the SDK needs is passed in an AppGantryConfiguration, a Sendable value you hand to AppGantryUpdates.

public struct AppGantryConfiguration: Sendable {
    public let baseURL: URL      // e.g. https://api.appgantry.com/sdk/v1
    public let appKey: String    // public, safe to embed in the app
    public let appSecret: String // authorizes enrollment for one channel
    public let platform: Platform // defaults to .iOS
}

Construct it directly:

let configuration = AppGantryConfiguration(
    baseURL: URL(string: "https://api.appgantry.com/sdk/v1")!,
    appKey: "<your-app-key>",
    appSecret: "<your-app-secret>"
)

The fields

baseURL

The SDK backend base URL. In production this is https://api.appgantry.com/sdk/v1. This is the /sdk/v1 surface documented in the API reference; it is separate from the /api/v1 surface used for build uploads.

appKey

A public identifier for your app on AppGantry. It is client-embeddable: it identifies which app is asking, and carries no authority on its own.

appSecret

The credential that authorizes enrollment. This follows the App Center app-secret model: the secret is embedded in your binary by design. It is scoped to a single channel, and it is revocable. It only authorizes exchanging itself for a per-install update token; it does not grant access to your organization, other channels, or the /api/v1 build surface.

The app secret is meant to ship in the binary

Unlike a project access token, the app secret is designed to live in the distributed app. Its blast radius is deliberately narrow (one channel, enrollment only) and you can revoke it from the web app if you need to. Do not reuse a project access token or a personal access token here.

platform

Defaults to .iOS. The Platform enum also models android, tvOS, watchOS, visionOS, and wearOS. It selects which platform's release the backend should answer for.

Where the app key and secret come from

Both values come from an SDK app, which you create on the channel you distribute through: open the channel, go to SDK apps, and Create SDK app.

  • The app key is shown in the SDK apps list at any time.
  • The app secret is shown once, at creation. Copy it then. AppGantry cannot show it again.

There is no rotate action. To replace a secret, revoke the SDK app and create a new one, then ship an app build carrying the new key and secret. Revoking takes effect immediately: enrolled installs stop being able to renew, and new enrollments are refused.

Because a revoked secret can't be fixed by an over-the-air update — the app has to be rebuilt and redistributed — stage the change: create the new SDK app, ship a build using it, wait for adoption, then revoke the old one. See Versioning & compatibility.

Next