# React Native reference (@tryyoursize/react-native)

> The native Size guide button and the shopper's recommended size in React Native, over the iOS and Android SDKs.

Source: https://docs.tryyoursize.com/reference/react-native/

*SDK* · `@tryyoursize/react-native` · v0.1.0

A thin wrapper over the native [iOS](https://docs.tryyoursize.com/reference/ios.md) and [Android](https://docs.tryyoursize.com/reference/android.md) SDKs: the button is the native one, the window is our window in a native sheet, and only sizes reach your JavaScript. React Native 0.73+; Expo Go is not supported (use a development build). Register `ios-app://<bundle id>` and `android-app://<package>` for your key in Studio.

## Install

**npm**

```bash
npm install @tryyoursize/react-native
cd ios && pod install
```

## Initialize

**React Native**

```tsx

await configure("pk_test_…"); // once, at startup
```

## Functions

| | |
|---|---|
| [`configure()`](https://docs.tryyoursize.com/reference/react-native/configure.md) | Call once at startup with your publishable key. |
| [`getRecommendation()`](https://docs.tryyoursize.com/reference/react-native/get-recommendation.md) | The shopper's recommended size for a product, in your size labels. |
| [`addRecommendationListener()`](https://docs.tryyoursize.com/reference/react-native/add-recommendation-listener.md) | Calls listener now (once known) and on every change. |
| [`addEventListener()`](https://docs.tryyoursize.com/reference/react-native/add-event-listener.md) | Window events: ready, open, close, size (preselect it), loaderror. |
| [`present()`](https://docs.tryyoursize.com/reference/react-native/present.md) | Opens the measuring / try-on window for a product. |
| [`setAppearance()`](https://docs.tryyoursize.com/reference/react-native/set-appearance.md) | Live restyle (e.g. |

## Components

| | |
|---|---|
| [`SizeGuide`](https://docs.tryyoursize.com/reference/react-native/size-guide.md) | The native "Size guide" button: "Size guide" → "Calculating your size…" → "Your size: M". |

## Types

| | |
|---|---|
| [`Recommendation`](https://docs.tryyoursize.com/reference/react-native/recommendation.md) | Recommendation |
| [`Appearance`](https://docs.tryyoursize.com/reference/react-native/appearance.md) | Appearance |
| [`TysEvent`](https://docs.tryyoursize.com/reference/react-native/tys-event.md) | A window event, by type. |
