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

# Apps

> Manages app registration and configuration, maintains an address-mapped app registry.

```rust theme={null}
use std::string;
use sui::dynamic_field;
use sui::package;
use sui::table;
use sage_admin::admin;
```

<Tip>
  Explore this module further in the Mover Registry: @sage/admin
</Tip>

## Structs

### `App`

Object that represents the application operating in the protocol, e.g. "Sage", "instagram-clone", "bucket", or "double-up". Developers may create different apps within the protocol to build social applications or augment their application with social capabilities.

```rust theme={null}
public struct App has key
```

<Expandable title="Fields">
  ```rust theme={null}
    id: UID,
    name: String,
    rewards_enabled: bool
  ```
</Expandable>

### `AppRegistry`

Registry that maintains a reference to every `App` on the protocol and maintains name-uniqueness.

```rust theme={null}
public struct AppRegistry has key
```

<Expandable title="Fields">
  ```rust theme={null}
    id: UID,
    registry: Table<String, address>
  ```
</Expandable>

## Functions

### `get_address`

Returns the address of the `App`'s id.

```rust theme={null}
public fun get_address(app: &App): address
```

<Expandable title="Implementation">
  ```rust theme={null}
    public fun get_address(
        app: &App
    ): address {
        app.id.to_address()
    }
  ```
</Expandable>

### `get_name`

Returns the name of the `App`.

```rust theme={null}
public fun get_name(app: &App): String
```

<Expandable title="Implementation">
  ```rust theme={null}
    public fun get_name(
        app: &App
    ): String {
        app.name
    }
  ```
</Expandable>

### `has_record`

Returns `true` if the case-insensitive app name is already in use, and `false` otherwise.

```rust theme={null}
public fun has_record(app: &App): bool
```

<Expandable title="Implementation">
  ```rust theme={null}
    public fun has_record(
        app_registry: &AppRegistry,
        app_key: String
    ): bool {
        app_registry.registry.contains(app_key)
    }
  ```
</Expandable>

### `has_rewards_enabled`

Returns `true` if rewards are enabled in the `App`, and `false` otherwise.

```rust theme={null}
public fun has_rewards_enabled(app: &App): bool
```

<Expandable title="Implementation">
  ```rust theme={null}
    public fun has_rewards_enabled(
        app: &App
    ): bool {
        app.rewards_enabled
    }
  ```
</Expandable>
