How to use Realm Gradle Plugin with Version Catalogs?

Hello. As part of an app migration, my team is moving to version catalogs using toml. But, there is an issue because I cannot find info about the correct id for the Realm Gradle Plugin. Currently I have this in build.gradle:

buildscript {
    dependencies {
        classpath 'io.realm:realm-gradle-plugin:10.15.1'
    }
}

And then, I have tried this in the libs.versions.toml file:

[versions]
realm-gradle-plugin = "10.15.1"

[plugins]
realm-gradle-plugin = { id = "io.realm:realm-gradle-plugin", version.ref = "realm-gradle-plugin" }

But this fails when trying to sync the project. I also have tried with variations like io.realm.realm-gradle-plugin and io.realm.realm.gradle.plugin, but these didn’t work either.

I am using it like this →

[versions]
realmGradlePlugin = "10.17.0"

[libraries]
realm-gradle-plugin = { module = "io.realm:realm-gradle-plugin", version.ref = "realmGradlePlugin" }

[plugins]
org-jetbrains-kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }

in

project level build.gradle:

plugins {
    alias(libs.plugins.androidApplication) apply false
    alias(libs.plugins.jetbrainsKotlinAndroid) apply false
    alias(libs.plugins.org.jetbrains.kotlin.kapt) apply false
}
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath(libs.realm.gradle.plugin)
    }
}

module level build.gradle:

plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.jetbrainsKotlinAndroid)
    alias(libs.plugins.org.jetbrains.kotlin.kapt)
    id("realm-android")
}