Accounts and keys¶
Every app that uses the DEA SDK is registered with DEA, once per platform. Registration gives you two values, which you pass to the SDK together:
| Value | What it is | Secret? |
|---|---|---|
appId |
Identifies your app to the SDK | No |
appKey |
Identifies your app to the DEA service. The SDK sends it in the X-App-Key header of every attestation and proof request |
No |
Neither value is a secret. Both ship inside your app or page, where anyone can read them, so they identify your app but do not authorize anything on their own. What makes a request trusted is the proof the device signs with a key DEA registered (see Attest).
Get an appId and appKey¶
DEA registers apps; there is no self-service sign-up. Ask your DEA contact to register each app and tell them:
| Platform | What identifies your app |
|---|---|
| Android | The application ID (package name) of the build you ship |
| iOS | The bundle identifier of the build you ship |
| Web | The origins your pages are served from, for example https://www.example.com |
| Flutter, React Native | Both of the above: your Android app and your iOS app are registered as two apps, each with its own pair |
You receive an appId and appKey pair for each registered app. For an Android app you also
receive a Google Cloud project number, which you pass as playIntegrityProject (see the
Android Attest guide).
Use the pair issued for the app
the build is: the DEA service files a device key under the app behind X-App-Key, and refuses a
proof signed by a device key filed under another app.
Pass them to the SDK¶
| Platform | appId |
appKey |
A production appId without appKey |
|---|---|---|---|
| Web | init({ appId }) |
init({ appKey }) |
Attest fails, Ads proofs are refused on the device, and getProof() resolves null with lastProofRefusal app_key_missing, without a request |
| Flutter | DeaOptions(appId:) |
DeaSdk.init(…, appKey:), the pair of the platform the app runs on |
Attest answers unsupported, and getProof returns null with lastProofRefusal app_key_missing, without a request |
| Android | DeaConfig(appId = …) |
DeaConfig(appKey = …) |
Attest answers UNSUPPORTED, and getProof returns null with lastProofRefusal app_key_missing, without a request |
| iOS | DeaSdkOptions(appId:) |
DeaSdkOptions(appKey:) |
Attest answers .unsupported, and getProof returns nil with lastProofRefusal app_key_missing, without a request |
| React Native | init({ appId }) |
init({ appKey }), the pair of the platform the app runs on |
Attest answers unsupported, and getProof resolves null with getLastProofRefusal() app_key_missing, without a request |
Capture and the classification work the same with or without appKey. When attest() answers
as in the last column, check the appKey first: the device is not the cause.
Since 0.20.8, no proof or signed request carries an appId. DEA takes the app from the device key
that signed it, and checks that it is the app of X-App-Key. The registryAppId option, which used
to set the signed appId, is deprecated and ignored on every platform. It stays so existing apps
still compile; remove it when you next update.
Which account the SDK runs as¶
The package you install decides what kind of account the SDK runs as, on every platform. The
appId does not, and the SDK never sends it in a header: a prefix such as test_, sandbox_ or
stg_ changes nothing.
| Package | The SDK runs as | What that means |
|---|---|---|
Production: the release URL has no /staging/ or /test/ in it |
A production account | It reads the production models, attestation and proofs need your appKey, and it writes no log. Nothing it captures leaves the device: DEA publishes no collection transporter for it |
Staging: /staging/ in the release URL |
A sandbox account | It reads DEA's staging models, logs INFO and up, and can collect data |
Test: /test/ in the release URL |
A test account | It reads DEA's test models, logs everything down to DEBUG, attestation falls back to a development key when no appKey is given, and it can collect data. It is for DEA's own testing: never ship it |
Pass the appId DEA issued for your app on every package. On the Web, Android and the React Native
bridges, appId has a default, 'unknown-app', an id DEA has not registered: always pass your
own. On React Native an empty appId stays empty. A staging or test package logs
sdk.app_id_missing when appId is missing, blank or unknown-app.
Attestation and proofs¶
appId and appKey matter as soon as the SDK talks to DEA:
- Attest registers the device's signing key with DEA. The registration is filed under the app
that
X-App-Keynames. - Proofs, such as the ones the Ads pages attach to impressions and clicks, carry
appKeyin the header and are signed with the device key. The service accepts one only whenappKeynames the app the device key is registered under.
Reading the classification needs neither: scoring runs on the device and makes no request.