Skip to main content

Add your SDK key

Without a key, your mod runs normally with reporting off, and the log says No SDK key found, reporting is off.

Bundle it in your jar​

Nitea reads nitea/<modid>.properties from your mod's resources:

src/main/resources/nitea/examplemod.properties
sdkKey=nt_your_sdk_key

The file is packed into your jar when you build, so released versions report with no extra setup. Keep it out of your repository:

.gitignore
src/main/resources/nitea/*.properties

Instead of a resource file, keep the key in a git-ignored .env and let Gradle write the properties file at build time. This is what the example mod does.

.env
NITEA_SDK_KEY=nt_your_sdk_key

Other ways to set the key​

Nitea uses the first key it finds, in this order:

SourceExample
Builder.sdkKey("nt_...")
JVM system property-Dnitea.examplemod.sdkKey=nt_...
Environment variableNITEA_EXAMPLEMOD_SDK_KEY=nt_...
Bundled resourcenitea/examplemod.properties containing sdkKey=nt_...

The system property and environment variable are handy on a test server, where you don't want the key in a file.

Is it safe to ship the key?​

Yes. The key can only send events to your project; it can't read or change anything. Like any client-side key, anyone can extract it from a released jar, so keep it out of your repository and regenerate it if it's ever abused.

If the Nitea API rejects the key, Nitea logs a warning and stays off until the next launch.