FDC3 Standard 1.2
v1.2 of the FDC3 standard, consisting of:
- API 1.2 [Specification] [Overview]
- Intents 1.2 [Specification] [Overview]
- Context Data 1.2 [Specification] [Overview]
- App Directory 1.2 [Specification] [Overview]
Release highlights
Raising an intent for a context type
The new raiseIntentForContext() method allows an application to start just with an FDC3 context data type, and then ask the desktop agent to raise an appropriate intent for that type.
This is similar to calling findIntentsByContext(), followed by raiseIntent(), but an application doesn't have to select from the available intents itself, or ask the user to. It allows the desktop agent to look up all matching intents and apps, and then use its own resolution logic (which could include an agent-provided selection dialog).
Example
const instrument = {
type: 'fdc3.instrument',
id: {
ticker: 'AAPL'
}
}
await fdc3.raiseIntentForContext(instrument)fdc3Ready event
Knowing when the window.fdc3 global object will be initialised and set by the current desktop agent was a challenge in earlier versions of FDC3. The 1.2 API specification adds the concept of a global fdc3Ready event that applications can listen for to know when the FDC3 desktop environment has been initialised, and the window.fdc3 global object is available for use:
Example
if (window.fdc3) {
action()
} else {
window.addEventListener('fdc3Ready', action)
}Specifying metadata for target applications
In FDC3 1.0 and 1.1, the open() and raiseIntent() methods accepts can target specific applications by specifying a string application identifier.
In FDC3 1.2, these methods (along with the new raiseIntentForContext() method) will now also accept the AppMetadata interface to help workflows to be even more targeted, and desktop agents to better identify target applications.
In addition, the AppMetadata interface has been expanded to optionally include appId and version.
Example
const target: TargetApp = {
name: 'MyApp',
version: '2.5'
}
await fdc3.open(target)Obtain information about the current FDC3 environment
A new getInfo() method has been added to FDC3 that returns metadata about the FDC3 implementation that is currently being used, which includes the FDC3 version, as well as (optionally) the provider name and version.
Example
const info = fdc3.getInfo()
console.log('FDC3 version: ' + info.fdc3Version)🚀 New Features
- New
raiseIntentForContext()method (#268) - New
fdc3Readyevent (#269) - New
getInfo()method that returns implementation metadata (#324)
💅 Enhancements
fdc3.open()andfdc3.raiseIntent()now takesTargetApp, which resolves tostring | AppMetadata(#272)AppMetadatareturn type can now optionally includeappIdandversion(#273)addContextListener(contextType, handler)now supports passingnullas the context type (#329)- Simplify API reference documentation and add info about supported platforms, including npm package (#349)
👎 Deprecated
🐛 Bug Fixes
- Return type of
getCurrentChannel()should bePromise<Channel | null>(#282) leaveCurrentChannel()is missing fromDesktopAgentinterface (#283)
See the CHANGELOG.md for full details.