LSEG Data Library for TypeScript

Session.Platform.Definition object

Creates a definition object for the platform session.

This method returns a definition of the platform session. This definition holds all the parameters that define the session to be created. Once the session is defined, a call to the getSession() method creates and returns the session.

Platform sessions are used to connect applications directly to the Delivery Platform (formerly Refinitiv Data Platform) or to a LSEG Real-Time Distribution System.

Syntax

Session.Platform.Definition(params: Session.PlatformSessionParams)

Parameters

An object literal that can include the below-listed properties:

Value Description Data type Optional Default value
appKey LDP Application key necessary to authenticate the specific application for the session string No -
grant Object with authentication parameters GrantPassword or GrantClientCredentials No -
dacs Streaming connection specification Dacs Yes -
host Server host that provides real-time data in own customer's network string Yes -
appName Defines an external app name which calls library string Yes LD-TS-JS-LIB

grant: GrantPassword

Value Description Data type Optional Default value
username Oauth username string No -
password Oauth password string No -
scope Defines limits the scope of RDP data services for this sign on session string Yes trapi
takeSignOnControl Defines whether the request for authorization will take control over any existing sign-on sessions for this user boolean Yes false

grant: GrantClientCredentials

Value Description Data type Optional Default value
clientId Oauth client id string No -
clientSecret Oauth client secret string No -
scope Defines limits the scope of RDP data services for this sign on session string Yes trapi
takeSignOnControl Defines whether the request for authorization will take control over any existing sign-on sessions for this user boolean Yes false

dacs: Dacs

Value Description Data type Optional Default value
applicationId The ID of the connecting application string Yes 256
username Username used for the streaming connection string Yes 'user' or machine login ID
position The IP address position of the logging application string Yes local machine's ip address or “127.0.0.1”

Returned value

A new instance of Session.Definition.

Usage

The following example demonstrates how to create a Definition object for platform session.

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.

333 words (1:45 mins)