License keys
The SDK authenticates with a license key that looks like NOSMAI-XXXX. Each key is issued for one app and is bound to:
- your app's package name (Android) or bundle identifier (iOS), or your site's domain (Web), and
- the platform (iOS, Android, or Web).
A key used from a different app, domain, or platform is rejected. Get your key from the Nosmai dashboard and pass it to init / initialize at startup.
Flutter and React Native wrap the native iOS and Android SDKs, so they use the same package-name / bundle-identifier binding as native.
The license key is an app-level identifier, not a server secret. It does not unlock anything on its own: the SDK verifies it with the Nosmai licensing service before any models load, and the encrypted models can only be decrypted after a valid check.
How verification works
- On the first launch, the SDK verifies the key online. The device must have connectivity this one time.
- After a successful check, the result is cached on the device for 24 hours, so later launches do not need the network.
- If the device is offline when the cache expires, the SDK keeps working for a further 24 hours of grace (48 hours total) before it must reconnect.
If the key is missing, invalid, or expired, initialization fails and the SDK does not run. Handle the failure return from init / initialize and do not moderate until it succeeds.
[!NOTE] Because the first launch needs connectivity and verification loads the models, always call init off the main thread.
What your license includes
A license enables a specific set of capabilities. The SDK only runs what your plan includes.
Moderation types
| Capability | Method |
|---|---|
| Image moderation | analyzeImage |
| Video moderation | analyzeVideo |
| Text moderation | moderateText |
| Live moderation | live camera / stream |
Detection categories: weapon, drug, cigarette, alcohol, and adult (NSFW).
If a moderation type is not in your plan, that call does nothing and returns a safe or empty result. If a detection category is not in your plan, it is never reported. Contact Nosmai to change what your license includes.
Going to production
Use your production license key in release builds, and keep test and production keys separate so test traffic does not count against production usage.
On web, register your production domain and use the key issued for it; a key bound to localhost or a staging domain will not work in production.