Backplane Client JS
Javascript client which allows web based desktop agents to connect and communicate with backplane through API.
Supported Operations
Usage example
import { BackplaneClient } from '@finos/fdc3-backplane-client';
const instrument = {
type: "fdc3.instrument",
id: {
ticker: "AAPL",
ISIN: "US0378331005",
FIGI: "BBG000B9XRY4",
},
};
var backplaneClient = new backplaneClient.BackplaneClient({
appIdentifier: {
appId: 'backplaneJSClient',
},
url: 'http://localhost:4475',
});
await backplaneClient.connect(
msg => {
if (msg.type == Fdc3Action.Broadcast) {
console.info(`Backplane Client: Recived broadcast over channel: ${msg.payload.channelId}`);
}
console.info(JSON.stringify(msg));
},
err => {
console.error(`Backplane Client: Disconnected.${err}`);
}
);
await backplaneClient.broadcast(instrument, "Channel 1");
Installation
To access the APIs in your application, simply install '@finos/fdc3-backplane-client' npm package:
npm install @finos/fdc3-backplane-client
yarn add @finos/fdc3-backplane-client
Use any of below to locally build and reference this package in your web application.
License
Copyright (C) 2022 Backplane open source project
Distributed under the Apache License, Version 2.0.
SPDX-License-Identifier: Apache-2.0