SDK Integration

Learn how to integrate our SDK in your existing app

Currently we support the following platforms for integration

PlatformSupport

Flutter

Android

Coming Soon

iOS

Coming Soon

Web

Coming Soon

Flutter

Run

$ flutter pub add digia_ui

or

Update your pubspec.yaml with

dependencies:
  digia_ui: ^0.0.5

In your main.dart call the DUIApp constructor like below.

DigiaUIClient.initializeFromNetwork(
    accessKey: "your_project_id",
    baseUrl: "https://app.digia.tech/api/v1",
    environment: Environment.staging,
    version: 1,
    developerConfig:
        DeveloperConfig(enableChucker: true, proxyUrl: ""),
    networkConfiguration: NetworkConfiguration(defaultHeaders: {}, timeout: 30),
  )

This will initialize the SDK. Lets understand each of the params

accessKey

type : string

required : true

This is your project id that you can get from the dashboard

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

type : enum Environment

staging, production, version

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

type : int

required : true

This field is ignored if environment is not set to Environment.version

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