SDK Integration
Learn how to integrate our SDK in your existing app
Currently we support the following platforms for integration
Platform | Support |
---|---|
Flutter | ✅ |
Android | Coming Soon |
iOS | Coming Soon |
Web | Coming Soon |
Flutter
Run
or
Update your pubspec.yaml
with
In your main.dart
call the DUIApp constructor like below.
This will initialize the SDK. Lets understand each of the params
accessKey
accessKey
type : string
required : true
This is your project id that you can get from the dashboard
baseUrl
baseUrl
type : string
required : false
default : https://app.digia.tech/api/v1
The default api url which the SDK will hit to fetch UI data. If you are using a self hosted version of our dashboard use that url.
environment
environment
type : enum Environment
required : true
Staging
Staging environment will pull the latest config changes that are made on the dashboard. Use this will your are developing or testing your flows.
Production
Production environment will pull the latest released version for the respective Platform(Android/iOS). You can release versions from the dashboard. If no version is released the app will throw an error if started with this environment.
Version
Version environment will take a numeric version value(see below) if you want to see the snapshot of your app at a specific version.
version
version
type : int
required : true
This field is ignored if environment is not set to Environment.version
developerConfig
developerConfig
type : DeveloperConfig
required : false
default : null
Use this during development to enable recording of api calls or enabling proxy. Takes an object of DeveloperConfig class requiring two params
enableChucker: boolean
This enables recording of api calls
proxyUrl: string
A string value in the format of ip:port if you want to use proxies like Proxyman or Charles.
networkConfiguration
type : NetworkConfiguration
required : true
This class holds all the network configuration required for your apis.
defaultHeaders: Map <String, dynamic>
Set the headers you want to send in all API calls that you've configured on the dashboard like Auth, x-device-id etc.
Any headers that are set in the API call on the dashboard are appended to these default headers. If a header is present in both defaultHeaders and API headers, its value will be picked from defaultHeaders.
timeout: int
Set api timeout value in seconds.
Last updated