| Artifact | implementation("com.nexaguard:nxg-sdk:1.+") |
| Minimum | API 24 · Kotlin 1.9 · AGP 8 |
| Footprint | ≈ 200 kB AAR |
settings.gradle (top‑level):
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
app/build.gradle.kts:
dependencies {
implementation("com.nexaguard:nxg-sdk:1.+") // always latest 1.x
}
Snapshot builds? Use
1.0.2-SNAPSHOTplus
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }.
@Composable
fun MainScreen() {
val ctx = LocalContext.current
LaunchedEffect(Unit) {
NexaGuardCMP.initialize(ctx, "YOUR_SETTINGS_ID")
}
Button(onClick = { NexaGuardCMP.showBanner(ctx, force = true) }) {
Text("Show CMP")
}
}
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// 1. initialise once
NexaGuardCMP.initialize(this, "YOUR_SETTINGS_ID")
// 2. UI that can re‑open the banner
Button(this).apply {
text = "Review Consent"
setOnClickListener { NexaGuardCMP.forceShowBanner(this@MainActivity) }
}.also { setContentView(it) }
}
}
| Call | Purpose |
|---|---|
initialize(context, settingsId) | Loads branding & GVL; persists consent locally. |
showBanner(context, force = false) | Shows banner (use force = true to reopen). |
acceptAllSelections() / rejectAllSelections() | Quick buttons inside second layer. |
applyCustomSelections(purposes, vendors) | Persist custom matrix from your own UI. |
NexaGuard CMP fully supports Google Consent Mode.
Basic configuration
Advanced configuration
Note: Consent Mode is a technical solution for tag management and measurement.
It does not by itself ensure legal compliance (such as with GDPR).
For more details and implementation options, see:
Consent Mode – Basic
Consent Mode – Advanced
Full docs ➜ https://developer.nexaguard.com
© 2025 NexaGuard Inc. All rights reserved.
