> For the complete documentation index, see [llms.txt](https://docs.onside.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onside.io/sdk/reference/example-app.md).

# Example App

A sample app showcasing OnsideKit features: login, fetching products, making purchases, and restoring purchases — as a reference implementation.

The sample app is a small, focused project that demonstrates the core OnsideKit flows end to end. It's a good starting point for seeing how the pieces fit together in a real project.

{% hint style="info" %}
[**View the Example App on GitHub**](https://github.com/onside-io/OnsideKit-iOS/tree/main/Example)
{% endhint %}

## What it demonstrates

<table><thead><tr><th width="260">Feature</th><th>API</th></tr></thead><tbody><tr><td>User authentication</td><td><a href="/sdk/core-concepts/authentication.md"><code>Onside.requestLogin</code></a> / on-demand login</td></tr><tr><td>Fetching products</td><td><a href="/sdk/products-and-subscriptions/fetching-products.md"><code>Onside.makeProductsRequest(productIdentifiers:)</code></a></td></tr><tr><td>Making a purchase</td><td><a href="/sdk/purchasing/making-a-purchase.md"><code>Onside.defaultPaymentQueue().add(_:completion:)</code></a></td></tr><tr><td>Restoring purchases</td><td><a href="/sdk/purchasing/restoring-purchases.md"><code>restoreCompletedTransactions(completion:)</code></a></td></tr></tbody></table>

## Required setup

The app won't run correctly until you complete two steps:

1. **Bundle Identifier** — the app's Bundle ID in Xcode must match the one you registered in the [Onside Developer Console](https://developer.onside.io).
2. **Product identifiers** — add your product identifiers in [`ProductsRepository.swift`](https://github.com/onside-io/OnsideKit-iOS/blob/main/Example/OnsideKitExample/ProductsRepository.swift), so the app can fetch your products.

The app also calls `Onside.initialize()` at launch, as every integration must — see [Initializing the SDK](/sdk/getting-started/initialization.md). It integrates the full **OnsideKit** product; see [OnsideKit vs OnsideKitLite](/sdk/advanced-and-tooling/onsidekit-lite.md) if you need the PassKit-free build.

Full instructions are in the [Example README](https://github.com/onside-io/OnsideKit-iOS/blob/main/Example/README.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.onside.io/sdk/reference/example-app.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
