# SDK

#### `Tebex.TebexUnity`

**Ready-to-use Unity MonoBehaviour components and a static store cache.**

The highest-level namespace for most Unity developers.&#x20;

Contains `StoreBrowser` (full store UI), `InGameCart` (slide-out shopping cart), `Deliverables` (post-purchase callback system), `Tebex` (static cache for store data and textures).

All components are designed to be dropped onto a GameObject and configured in the Inspector.

***

#### `Tebex.Common`

**Shared utilities and base types used across all other namespaces.**

Contains callback delegate definitions (`ApiSuccessCallback`, `PluginApiErrorCallback`, `ServerErrorCallback`), the three error types (`HeadlessApiError`, `PluginApiError`, `ServerError`), an `HttpVerb` enum, a JSON serialization wrapper, and a `Scheduler` helper. You rarely interact with this namespace directly, but its error types appear in every API callback signature.

***

#### `Tebex.Headless`

**Client-side store API for browsing products, managing baskets, and initiating checkout.**

This is the primary API namespace for Unity game clients.&#x20;

`HeadlessApi` is the singleton entry point. It provides synchronous and `Task`-based async methods to fetch the `Webstore`, `Category` list, `Package` list, and to create and modify `Basket` objects.&#x20;

Note that we use an adapter pattern (`HeadlessAdapter` / `UnityHeadlessAdapter`) which abstracts the HTTP layer so the API logic is testable outside of Unity's runtime.

***

#### `Tebex.Plugin`

**For dedicated server integrations.**

`PluginApi` authenticates with a **secret key** and exposes endpoints for various tasks that are normally performed on a dedicated game server or backend, such as:

* command queue polling,&#x20;
* player lookups,&#x20;
* payment history,&#x20;
* gift card management,&#x20;
* coupon management,&#x20;
* ban management,&#x20;
* and community goal tracking.&#x20;

This is intended for use on a dedicated server build or cloud function, not in the game client.

***

#### `Tebex.QR`

**C# QR code generation and decoding**

`QrCode` encodes HTTPS URLs into compact QR data and exposes a `bool[,]` module grid or raw `byte[]` representation for rendering.&#x20;

The `Utilities.QrToTexture()` helper in `Tebex.TebexUnity` converts a `QrCode` into a `Texture2D` for display as a UI image or world-space sprite.

***

#### `Tebex.Examples`

**Placeholder classes demonstrating how to structure integrations.**

Contains stub classes intended as starting points for custom integrations. Copy and extend these for your needs. See [examples](https://docs.tebex.io/developers/unity-engine/examples "mention")for Unity-specific examples.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/developers/unity-engine/sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
