# NubrickProvider

`NubrickProvider` は Jetpack Compose でオーバーレイ配信を有効化するためのラッパーです。

{% hint style="warning" %}
`NubrickProvider` を利用する前に `NubrickSDK.initialize(...)` を完了してください。\
推奨: `Application` の `onCreate` で初期化してから、`Activity` のルート Composable を `NubrickProvider { ... }` で包む。
{% endhint %}

### 定義

```kotlin
@Composable
fun NubrickProvider(
    content: @Composable () -> Unit
)
```

### 使い方

```kotlin
import android.app.Application
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import app.nubrick.nubrick.Config
import app.nubrick.nubrick.NubrickProvider
import app.nubrick.nubrick.NubrickSDK

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        NubrickSDK.initialize(
            context = this,
            config = Config(projectId = "<YOUR_PROJECT_ID>")
        )
    }
}

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContent {
            NubrickProvider {
                AppContent()
            }
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nubrick.app/reference/android/nubrickprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
