# SessionConfigKt

Added in 1.7.0-rc02

*** ** * ** ***


```
public final class SessionConfigKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/SessionConfig` | `https://developer.android.com/reference/androidx/camera/core/SessionConfigKt#sessionConfig(kotlin.collections.List,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/UseCase> useCases, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/SessionConfigScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block )` Creates a `https://developer.android.com/reference/androidx/camera/core/SessionConfig` using a Kotlin DSL. |

## Public methods

### sessionConfig

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/SessionConfig.kt+function:sessionConfig)

```
public static final @NonNull SessionConfig sessionConfig(
    @NonNull List<@NonNull UseCase> useCases,
    @NonNull Function1<@NonNull SessionConfigScope, Unit> block
)
```

Creates a `https://developer.android.com/reference/androidx/camera/core/SessionConfig` using a Kotlin DSL.

Example usage:

```
val sessionConfig = sessionConfig(useCases) {
    isAutoRotationEnabled = true
    viewPort = viewPort
}
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/UseCase> useCases` | The list of `https://developer.android.com/reference/androidx/camera/core/UseCase` to be attached to the camera. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/core/SessionConfigScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block` | A lambda to configure the `https://developer.android.com/reference/androidx/camera/core/SessionConfigScope`. |