Get API key and org ID
You need two credentials before making any API calls: an API key and your organization ID. Both are available in the platform dashboard — no code required.
Step 1 — Open API Settings
Section titled “Step 1 — Open API Settings”- Sign in to https://platform-dev.truconsent.io.
- Go to Settings → API Settings.
Step 2 — Generate an API key
Section titled “Step 2 — Generate an API key”Two key scopes are required for the Flutter SDK integration:
| Scope | Used for |
|---|---|
| Admin-scope key | Fetching assetId and bannerId from the Management API |
| Consent-scope key | Runtime API calls made by TruConsentModal and NativeRightCenter |
- Click Generate API Key.
- Select Admin scope — copy the key. You will use this only during setup to fetch asset and collection point IDs.
- Generate a second key, select Consent scope — this is the key you embed in your Flutter app as
apiKey.
Step 3 — Copy your org ID
Section titled “Step 3 — Copy your org ID”Your organization ID is displayed on the same API Settings page under Organization ID.
Copy it — you will pass it as organizationId to TruConsentConfig, TruConsentModal, and NativeRightCenter.
Step 4 — Add allowed origins
Section titled “Step 4 — Add allowed origins”Under Allowed Domains, add your application’s bundle identifier or any domain used in consent flows (e.g. com.example.myapp).
Requests from unlisted origins are rejected with 403 Forbidden.
Result
Section titled “Result”You now have the following values:
Organization ID: your-organization-idAdmin-scope API key: your-admin-scope-key (setup only — not embedded in the app)Consent-scope API key: your-consent-scope-key (embedded in the Flutter app)Store the consent-scope key securely — for example, via Flutter’s --dart-define at build time or a remote config service. Do not commit it to source control.