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

# @portal-hq/keychain

> The @portal-hq/keychain package contains a storage adapter intended for use with the @portal-hq/core package. This storage adapter allows end users to save MPC shares to their local device keychain using the iOS Keychain.

The `@portal-hq/keychain` package contains a storage adapter intended for use with the `@portal-hq/core` package. This storage adapter allows end users to save MPC shares to their local device keychain using the iOS Keychain.

### Basic usage

<Note>
  Adding **Face ID** support on iOS:

  Add the following tags to your `info.plist` file if it does not already exist:

  ```xml theme={null}
  <key>NSFaceIDUsageDescription</key>
  <string>Accessing your stored share</string>
  ```
</Note>

#### Install the package in your React Native project.

<Tabs>
  <Tab title="yarn">
    ```bash theme={null}
    yarn add @portal-hq/keychain
    ```
  </Tab>

  <Tab title="npm">
    ```bash theme={null}
    npm install --save @portal-hq/keychain
    ```
  </Tab>
</Tabs>

#### Import the package into the component where you initialize the Portal class

```typescript theme={null}
import Portal from '@portal-hq/core'
import Keychain from '@portal-hq/keychain'
```

#### Register your storage adapter and initialize the Portal class

```typescript theme={null}
const keychain = new Keychain()
const portal = new Portal({
  // ...your other config options
  keychain,
})
```

### Dependency linking

Because this package uses the `react-native-keychain` package (which contains native modules) there is some additional linking required to make it work with your React Native project.

Explicitly install the `react-native-keychain` package in your project.

<Tabs>
  <Tab title="yarn">
    ```bash theme={null}
    yarn add react-native-keychain
    ```
  </Tab>

  <Tab title="npm">
    ```bash theme={null}
    npm install --save react-native-keychain
    ```
  </Tab>
</Tabs>
