# TryYourSize(context, publishableKey, configuration)

> Creates the client for your publishable key.

Source: https://docs.tryyoursize.com/reference/android/constructor/

*Constructor* · `com.tryyoursize:tryyoursize-android`

Creates the client for your publishable key. Keep one per app.

```kotlin
public class TryYourSize @JvmOverloads constructor(
    context: Context,
    public val publishableKey: String,
    public val configuration: Configuration = Configuration(),
)
```

## Parameters

- **`context`** (`Context`, required): Any context; the application context is kept.
- **`publishableKey`** (`String`, required): Your publishable key (`pk_test_…` / `pk_live_…`).
- **`configuration`** (`Configuration`, optional, default `Configuration()`): See `Configuration`(/reference/android/configuration/).

## Errors

`TryYourSizeException` with code `SECRET_KEY_IN_APP`, `INVALID_KEY`, `INVALID_APP_IDENTIFIER` or `INVALID_OPTION`.

## Example

**Kotlin**

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

**Swift**

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

**React Native**

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

**Flutter**

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