Options
All
  • Public
  • Public/Protected
  • All
Menu

Getting Available Services

Developer Chat Apache 2.0 License Typescript Web


Getting Available Services

The SDK Provides a function which you can use to determine what services can be onboarded for your contract. The Contract you pass in must be a READ contract, which means it's a contract that asks for user's data.

Configuration Options

See all possible configurations when initializing the SDK.

Returns

The available services.

Service describes the different service groups

Examples

The most basic initialization:

// Initialize the SDK
import {init} from "@digime/digime-sdk-nodejs";
const sdk = init({ applicationId: <you-application-id> });

const services = await sdk.getAvailableServices(<read-contract-id>);

For a contract that only asks for Twitter data, the response might be:

[{
    "name": "Twitter",
    "publishedDate": 1518428711000,
    "publishedStatus": "approved",
    "reference": "twitter",
    "id": 2,
    "serviceGroups": [
        {
            "id": 1
        }
    ],
    "countries": [],
    "homepageURL": "https://twitter.com",
    "title": "Add your Twitter...",
    "subTitle": "Your tweets, likes and mentions",
    "resources": [
        {
            "mimetype": "image/png",
            "resize": "fit",
            "type": 0,
            "url": "https://securedownloads.digi.me/static/development/discovery/services/twitter/icon25x25.png",
            "aspectratio": {
                "accuracy": 100,
                "actual": "1:1",
                "closest": "1:1"
            },
            "height": 25,
            "width": 25
        }
    ]
}]

Generated using TypeDoc