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

# Usage

> Description about how to use with Expo

## Installation

To install the Useawards Expo SDK, you can use npm or yarn. In your project directory, run one of the following commands:

<CodeGroup>
  ```bash npm theme={null}
  npm install @useawards/useaward-expo
  ```

  ```bash yarn theme={null}
  yarn add @useawards/useaward-expo
  ```
</CodeGroup>

## Usage

A token cache is required to work with Useaward and Expo. This is entirely up to you how you handle the token cache - in this example we're going to use the expo-secure-store library. First, install it by running

```shell theme={null}
npm i expo-secure-store
```

To use the Useawards SDK in your application, you need to import the desired package(s) and configure them with your API and APP key:

```jsx theme={null}
import { UseawardProvider } from "@useawards/useaward-expo";
import * as SecureStore from "expo-secure-store";

const cache = {
  getUserUuid(key) {
    try {
      return SecureStore.getItemAsync(key);
    }
    catch (err) {
      return null;
    }
  },
  saveUserUuid(key, value) {
    try {
      return SecureStore.setItemAsync(key, value);
    }
    catch (err) {
      return null;
    }
  },
};

function App() {
  return (
    <UseawardProvider
        publishableKey=''
        appId=''
        cache={cache}>
      {/* Your app code here */}
    </UseawardsProvider>
  );
}
```
