<!-- AI agents: this is the Markdown version of an AppNorth documentation page. Index: https://www.appnorth.app/llms.txt -->

# Install the SDK

Add the `AppNorth` product to an iOS app targeting iOS 16 or later. SwiftUI screens work directly; UIKit apps can use a [hosting controller](/docs/uikit).

## Add the package {#add-package}

In Xcode, choose **File → Add Package Dependencies…**, enter the URL below, and link **AppNorth** to your app target. Select version `0.2.0` or a compatible later version. Distribution uses a compiled XCFramework.

```text title="Swift package URL"
https://github.com/victorgxn/appnorth-ios
```

For a project managed with a Swift package manifest, merge these entries into its existing dependency and target lists:

```swift title="Package.swift dependency entries"
// Package.swift
dependencies: [
    .package(url: "https://github.com/victorgxn/appnorth-ios", from: "0.2.0")
],
targets: [
    .target(name: "MyApp", dependencies: [
        .product(name: "AppNorth", package: "appnorth-ios")
    ])
]
```

## Configure once {#configure}

Copy the public App ID, server base URL, and allowed origin from your project's SDK setup. Retain one client for the session and inject it into your screens. Configuration throws before making a request if the URLs or App ID are invalid.

```swift title="AppNorthSetup.swift"
import Foundation
import AppNorth

func makeAppNorthClient(appID: String, allowedOrigin: URL) throws -> AppNorthClient {
    let configuration = try AppNorthConfiguration(
        apiURL: URL(string: "https://www.appnorth.app")!,
        appId: appID,
        origin: allowedOrigin
    )
    return AppNorthClient(configuration: configuration)
}
```

Use the server base URL without `/api/v1`; the client appends endpoint paths. `origin` contains only a scheme, host, and optional port. It must be allowed for your project. This is required for native writes too: it is an anti-abuse signal, not an identity credential. Use HTTPS in production.

The App ID is public. Keep identity signing secrets, App Store Connect keys, and RevenueCat secret API keys on your backend. For account-based actions, [install a signed identity credential](/docs/verified-identity) before opening the screen.

## Open a screen {#open-screen}

Pass the retained client into your existing navigation or sheet:

```swift title="CommunityScreen.swift"
import SwiftUI
import AppNorth

struct CommunityScreen: View {
    let client: AppNorthClient

    var body: some View {
        AppNorthView(client: client)
    }
}
```

`AppNorthView` owns its navigation stack. For a support-only entry, use [AppNorthChatView](/docs/support-chat).

## Verify {#verify}

1. Build and run your app, then open the community screen. A project with no ideas should show an empty state, not a connection error.
2. Load `try await client.boards()` and confirm the returned boards belong to your project.
3. Enable an appropriate submission or chat policy in the dashboard, send a clearly labeled test message, and find it in the same project's inbox.
4. If reads work but writes fail, check the allowed origin. On a physical device, a local development server must use an address reachable from that device.
