Never ship your API key in the app
Your deepidv API key can create sessions, read verification results and spend your balance. Anything inside an app (a string, a plist, an obfuscated value) can be extracted by anyone who downloads it. Run the SDK through your own backend instead:- The app sends the SDK’s requests to your backend, signed with your app’s own user token.
- Your backend checks the user, checks that the request is for one of their sessions, adds your deepidv API key, and forwards it to deepidv.
baseURL to your backend and pass your user token as apiKey.
Short-lived session tokens, issued by your backend for one session, are planned. When they ship, they’ll be the simplest way to run the SDK without a key on the device. Proxy mode keeps working.
Don’t trust onResult for the decision
Code on a user’s device can be changed by that user. Use the SDK’s result to decide what to show next, never to grant access.
A session can also change after the app is done with it. A manual reviewer can approve or reject it in the Admin Console, for example. See Results and the decision.
Create sessions on your backend
You can letDeepIDVWorkflowView create a session from the app, but then the app needs to send the user’s name and email to the API. Creating the session on your backend keeps that step on the server, ties the session to a signed-in user, and lets your proxy reject requests for anyone else’s session. See Sessions from your backend.
What the SDK does for you
- The API key (or token) you pass is sent only in the
x-api-keyheader, over HTTPS. It’s redacted in every error and description the SDK produces. - Photos upload over HTTPS to short-lived presigned URLs. They’re never written to the photo library.
- Requests that fail with
429or a5xxare retried with exponential backoff. Requests that fail for any other reason are not retried automatically.