> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pool.day/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Add the package, ask for access, and run your first query against a person's camera roll in about ten minutes.

PoolKit reads a person's photos and screenshots on their device and turns them into things your app can use: products, places, events, recipes, books, music, movies, articles, posts and links. Your app asks for a narrow grant, then asks questions. Photos never leave the device.

## Requirements

* iOS 18 or later.
* Xcode 27, the version PoolKit is built and tested with.
* An app key from the [dashboard](https://pool.day/developers/dashboard). Test keys start with `pk_test_` and live keys with `pk_live_`. PoolKit is in early access: [book a demo](https://pool.day/developers) and we turn on your account for keys.

## 1. Add the package

In Xcode choose File, Add Package Dependencies and enter the package URL, or add it to `Package.swift`:

```swift theme={null}
.package(url: "https://github.com/ram-company/pool-kit", from: "0.2.0")
```

Building with React Native or Expo, or with CocoaPods? See [React Native and Expo](https://docs.pool.day/expo.md); the same SDK ships as an Expo module, a pod and an XCFramework.

PoolKit builds on four open source packages: GRDB, SQLiteData, Swift Async Algorithms and Swift Collections. SQLiteData uses Swift macros, so Xcode asks you once to trust them; on a build machine pass `-skipMacroValidation` to `xcodebuild`. The engine's models, about 375 MB, are not in the package. PoolKit downloads them on Wi-Fi after indexing starts, and answers from text and labels until they arrive. See [Indexing](https://docs.pool.day/indexing.md).

## 2. Say why you need photos

iOS shows this sentence in the photo library prompt. Write the benefit to the person, in your app's own words.

```xml theme={null}
<key>NSPhotoLibraryUsageDescription</key>
<string>Find the things you saved, so we can suggest gifts you will like.</string>
```

## 3. Open the client

Open one client at launch and keep it. Opening is fast and works offline.

```swift theme={null}
import PoolKit

let pool = try await PoolClient.open(
    configuration: PoolConfiguration(appKey: "pk_test_…")
)
```

## 4. Ask for access

A grant names which sources, which kinds of things and which operations your feature needs, and why. The first request shows the system photo prompt. Indexing starts once a grant exists and never before.

```swift theme={null}
let grant = try await pool.authorization.requestAccess(
    AccessRequest(
        sources: [.screenshots, .photos],
        data: [.products, .places],
        purpose: "Suggest gifts from the things you saved"
    )
)
```

## 5. Ask a question

```swift theme={null}
let result = try await pool.context.query("sneakers I saved last month", using: grant)

for match in result.matches {
    print(match.summary, match.provenance, match.confidence)
}

// An empty answer only means "nothing there" when coverage is complete.
if result.matches.isEmpty, !result.coverage.isComplete {
    print("Still indexing: \(result.coverage.indexedAssets) of \(result.coverage.knownAssets)")
}
```

That is the whole loop. Next, read [Grants](https://docs.pool.day/grants.md) to scope access well, [Search and browse](https://docs.pool.day/search.md) to find the photos themselves, and [Testing](https://docs.pool.day/testing.md) to run all of this in unit tests without a photo library.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.