# configure()

> Call once at startup with your publishable key.

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

*Function* · `@tryyoursize/react-native`

Call once at startup with your publishable key. Register your app for the key in Studio: `ios-app://<bundle id>` and `android-app://<package>` (test mode today).

```ts
function configure(publishableKey: string, options: ConfigureOptions = {}): Promise<void>
```

## Parameters

- **`publishableKey`** (`string`, required): Your publishable key (`pk_test_…` / `pk_live_…`).
- **`options`** (`ConfigureOptions`, optional, default `{}`)
  - **`appearance`** (`Appearance`, optional)
  - **`locale`** (`string`, optional): BCP 47; default: the device language.
  - **`embedOrigin`** (`string`, optional): Our window's origin, for staging or local development only.

## Errors

An `Error` for a secret key or a malformed key, before anything reaches the native side.

## Example

**React Native**

```tsx
await configure("pk_test_…", { appearance: { variables: { borderRadius: 10 } }, locale: "es" });
```

**Swift**

```swift
let tys = try TryYourSize(publishableKey: "pk_test_…", configuration: .init(
    appearance: Appearance(borderRadius: 10),
    locale: "es"))
```

**Kotlin**

```kotlin
val tys = TryYourSize(context, "pk_test_…", TryYourSize.Configuration(
    appearance = Appearance(borderRadius = 10f),
    locale = "es",
))
```

**Flutter**

```dart
final tys = await TryYourSize.create('pk_test_…', appearance: const Appearance(borderRadius: 10), locale: 'es');
```
