Skip to main content
The SDK is unlocked by a license key that NEUROFIT issues for your app identifiers. Verification happens on the device, with no network call and nothing stored. A paid (perpetual) key never reads the device clock.
Licensing at a glance. The license is perpetual, with no per-user or per-scan fees. It includes updates until a date written in your key (updatesUntil), and the builds you ship keep working after it. neurofit.app/vitals-sdk

Installing the key

Call activate early in every launch, before you start a session. The key is a single string.
activate throws (or rejects) licenseInvalid when the key is not accepted (licenseInvalid reasons). Natively it is synchronous and safe from any thread. The key is held in memory only, and until activate succeeds, starting a session throws notActivated. It checks Bundle.main.bundleIdentifier on iOS and the application id (context.packageName) on Android. It returns the key’s warnings, which stay empty unless a debug build relaxed a check. Keep the key out of git: an uncommitted xcconfig, a Gradle property from ~/.gradle/gradle.properties or CI secrets, a --dart-define, or your config system. It works only for your app identifiers, so a leak does not let anyone else ship the SDK, but it is still licensed material.

Download token

NEUROFIT issues a download token to your organization. Your build tools use it to fetch the packages from sdk.neurofit.app. It never ships in your app, and the SDK never contacts that host. The token is the password, and any username works. Keep it out of git like any credential. Ask for one token per CI system to revoke them separately. If a token leaks, ask NEUROFIT to revoke it and issue a new one. A 401 or Unauthorized while resolving means the token is missing or revoked (Build and integration).

What updatesUntil means

updatesUntil is the end of your maintenance period:
  • Every SDK build has a build date, given in the changelog.
  • A key accepts any SDK build dated on or before its effective date: the earlier of your updatesUntil and the certificate’s maxUpdatesUntil. If the certificate’s date comes first, NEUROFIT re-issues your key under a newer issuing key, keeping your updatesUntil.
  • A build released after the effective date refuses the key with licenseInvalid, and the reason names the date.
  • Builds you already ship keep working. With a paid key, nothing expires inside installed apps.
When maintenance lapses, you keep using the last SDK released during it. When you renew, your new key has a later updatesUntil.

Trial keys

A trial key unlocks the SDK until a set moment, written in the key as expiresAt in UTC (for example 2026-10-31T23:59:59Z). From then on the SDK stops starting readings. Paid keys have no expiresAt.
  • The end is checked against the device clock, offline, by activate and by every start(), in debug builds too.
  • After the end, both throw licenseInvalid with the reason the trial key expired on 2026-10-31 23:59 UTC. A session that has already started runs to its end, including the readings it restarts by itself after a cancel.
  • Every app that carries the trial key stops starting readings at its end, installed copies included. To continue, ship your paid key in an app update before then.
  • The check is offline, so a device whose clock is set back keeps a trial key working. The end is a commercial boundary set by your trial agreement, not copy protection.

Debug builds

In development the app-identifier check can relax, so activate succeeds under identifiers the key does not list:
  • Android decides at runtime: a debuggable app (ApplicationInfo.FLAG_DEBUGGABLE) activates, a release build is rejected.
  • iOS binary (the hosted package, also inside the React Native, Flutter and Capacitor packages) never relaxes it, so the key must list every bundle identifier you run, development ones included.
  • iOS from source relaxes in your Debug configuration (#if DEBUG inside NeurofitVitals).
When a debug build accepts a key only this way, activate tells you. It returns a warning in warnings (iOS, Android, wrappers) and logs it, in the Xcode console or in Logcat with the tag NeurofitVitals. The React Native, Flutter and Capacitor packages also print it in development. For example:
Release builds refuse that key, so ask NEUROFIT for a key that lists the identifier before you ship. Showing warnings next to your activation status on a debug screen makes it easy to spot. A trial key’s end never relaxes.

Several app identifiers

One key can list several identifiers (production, staging, a white-label variant). Ask NEUROFIT to include every identifier you ship under. Adding one later means a new key, and the old key keeps working.

licenseInvalid reasons

The reason is a short English sentence for your logs (Swift licenseInvalid(reason:), Kotlin LicenseInvalid(reason), the wrappers’ message). It names the check that failed:

Security review

How a key is signed. NEUROFIT signs your license with an issuing key. Your key carries that issuing key’s certificate, signed by one of two offline root keys, root-a or root-b. The SDK embeds only the two root public keys. It checks the root’s signature on the certificate, then the issuing key’s signature on your license, so NEUROFIT can change issuing keys without an SDK release.Key format. NFV2.<certificate>.<root signature>.<payload>.<issuer signature>. Each part after NFV2 is base64url without padding. Both signatures are ECDSA P-256 with SHA-256 in strict DER, with nothing after the signature. The issuer signature also covers the certificate, so a payload cannot move under another certificate.Verification order. The first failing check throws licenseInvalid:
  1. Shape: leading and trailing ASCII whitespace (space, tab, CR, LF) is trimmed. The rest is pure ASCII, five dot-separated parts, the first NFV2, the others non-empty canonical base64url without padding.
  2. The certificate names a root compiled into this SDK, whose signature verifies over the bytes NFV2.<certificate>.
  3. The certificate’s fields are as above (alg exactly ES256, v the integer 1, pub a P-256 key, dates exactly YYYY-MM-DD).
  4. This SDK build does not refuse the issuing key.
  5. The issuing key’s signature verifies over the bytes NFV2.<certificate>.<root signature>.<payload>.
  6. The payload’s fields are as above, and its kid equals the certificate’s.
  7. The SDK build date is on or before the earlier of updatesUntil and maxUpdatesUntil (string comparison).
  8. The app identifier is in apps, compared exactly and case-sensitively.
  9. For a trial key, the device clock is still before expiresAt. Only this check reads the clock, and debug builds run it even when they relax check 8.
Rotation and revocation. Keys from a new issuing key work with every released SDK build, and your existing key keeps working. A shipped build has no server, so it keeps accepting every key that was valid for it, a trial key until its expiresAt. For new builds:
  • A new SDK build can refuse an issuing key. If one were exposed, that release would ship with re-issued keys for every licensee under maintenance.
  • An issuing key never unlocks an SDK built after its maxUpdatesUntil, so certificates are kept short (two years by default).
  • The two roots back each other up: if one were lost, the other keeps certifying issuing keys.
Lost keys are re-issued on request.

Source licenses

A source license ships the engine and SDK sources. Your build still calls activate with a key of type source, which verifies the same way (Install from source or manually). You can also replace the root keys or the check itself: the license agreement, not the key, governs your use.

Questions

Licensing questions go to contact@neurofit.app. Include your licensee name and the kid from your key.