LSEG Data Library for TypeScript

getSession

Method used to create and return a session defined by Session.Platform.Definition object.

Syntax

sessionDefinition.getSession()

Parameters

None.

Returned value

Promise<Session.Session>

Usage

The following example demonstrates how to create a definition object and get the platform session instance.

import { Session } from "@lsegroup/data";

const platformSession = Session.Platform.Definition({
  appKey: "appKey",
  grant: {
    userName: "username",
    password: "password",
    takeSignOnControl: true,
  },
}).getSession();

await platformSession.open();
import { Session } from "@lsegroup/data";

const platformSession = Session.Platform.Definition({
  appKey: "appKey",
  grant: {
    clientId: "clientId",
    clientSecret: "clientSecret",
    takeSignOnControl: true,
  },
}).getSession();

await platformSession.open();

None.

29 words (0:09 mins)