API Docs for: 2.0.20133.2
Show:

MsSupportSdk Class

Defined in: src\sdk\sdk.ts:26
Module: SDK

Global object reference for the Microsoft Support Web SDK

Item Index

Methods

Properties

Methods

init

(
  • config
)
Promise static

Defined in src\sdk\sdk.ts:32

Initialize the SDK

Parameters:

  • config Object

    a collection of initialization parameters that control the setup of the SDK

    • partnerId String

      a uniquely identifying string to differentiate telemetry per partner

    • appId String

      a uniquely identifying string to differentiate telemetry per partner app

    • sessionId String

      a unique id used for tracking purpose. SDK will generate one if not supplied

    • correlationVector String

      jsll correlation vector. SDK will generate one if not supplied

    • logger String

      a custom logger which must expose a writeEvent(data) method. The 'data' param can be an IncomingRequest, OutgoingReqeust or ClientError

Returns:

Promise:

a promise that resolves when the SDK is loaded and rejects when loading fails

Example:

var sdk = winodw && window.MsSupportSdk; // Get a reference to the global MsSupportSdk object
// var sdk = require("MsSupportSdk"); // Load the Web SDK module using a module loader. i.e. requirejs

// uncomment to use custom logger for Qos events
// var customLogger = {
//    writeEvent: function(data) {
//        console.log(JSON.stringfy(data));
//    }
// };

if(sdk) {
    var sdkConfig = {
        partnerId: "SomePartnerId",
        appId: "SomeAppId",
        sessionId: "123-456-789", // this is optional
        correlationVector: "AQnf0OTUGFKmhX46.0", // this is optional
        // logger: customLogger // uncomment to use custom logger to log Qos events
    };

    sdk.init(sdkConfig).then(
        function(){
            console.log("Microsoft Support SDK initialized.");
        },
        function(err){
            console.log("Unabled to initialize Microsoft Support SDK. Error: " + err.message);
        });
}

Properties

version

String static

Defined in src\sdk\sdk.ts:76

SDK version currently being referenced