36.80.11 • Published 3 days ago

@openfin/node-adapter v36.80.11

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
3 days ago

OpenFin Node.js adapter

Allows the use of the OpenFin API from node.js. Please note the launch and connect methods are specific to a node environment.

Requirements

  • Node.js 16 or greater

Usage

Connect

connect can be used to establish a connection to an OpenFin runtime from node.

A uuid must be provided to identify the connection. Multiple connections will require distinct uuids.

A runtime version or manifest url must also be specified.

Note - connect will instantiate a runtime instance if one does not exist for the given configuration. If the runtime is already running, connect will simply establish a new connection.

Connecting via Runtime Version

import { connect } from '@openfin/node-adapter';

(async () => {
    const fin = await connect({
        uuid: 'my-uuid-123',
        runtime: {
            version: 'stable'
        }
    });
    await fin.Platform.startFromManifest('http://www.your-domain-goes-here.com/manifest.json');
})();

Connecting via Manifest Url

import { connect } from '@openfin/node-adapter';

(async () => {
    const fin = await connect({
        uuid: 'connection-id',
        manifestUrl: 'http://www.your-domain-goes-here.com/manifest'
    });
})();

Launch

Unlike connect, launch starts an OpenFin application if not running and returns a port number instead of a fin object.

This can be provided to connect to create a fin object for the runtime that has been created on the specific port.

launch can be called multiple times for a given application, however launches for an application that is already running will result in a run-requested event being triggered instead of a relaunch. If the application is an OpenFin platform, this will result in the layout windows reloading.

Launching and Connecting via Port

import { launch, connect } from '@openfin/node-adapter';

(async () => {
    const port = await launch({
        manifestUrl: 'http://www.your-domain-goes-here.com/manifest'
    });

    const fin = await connect({
        address: `ws://localhost:${port}`,
        uuid: 'external-app-via-launch'
    });

    console.log(await fin.System.getRuntimeInfo());
})();

Types

@openfin/node-adapter comes bundled with its own types types.

If you wish to explicitly reference OpenFin types, the OpenFin namespace export may be used as follows:

Type Usage Example

import OpenFin, { connect } from '@openfin/node-adapter';

(async () => {
    const fin: OpenFin.Fin<'external connection'> = await connect({
        uuid: 'connection-id'
    });
    const platform: OpenFin.Platform = await fin.Platform.startFromManifest(
        'http://www.your-domain-goes-here.com/manifest'
    );
})();

Migrating from openfin-adapter to @openfin/node-adapter

For users of the connect and launch functions in openfin-adapter, no changes are necessary, other than updating the dependency name.

If using the exported types from openfin-adapter, an OpenFin export has been created that encapsualates them.

Before

import { launch, connect, Application, Fin } from 'openfin-adapter';

(async () => {
    const fin: Fin = await connect({
        uuid: 'external-connection-1', 
        runtime: { version: 'stable' } 
    });
    const app: Application = await fin.Application.start({...});
})()

After

import OpenFin, { launch, connect } from '@openfin/node-adapter';
(async () => {
    const fin: OpenFin.Fin<'external connection'> = await connect({ 
        uuid: 'external-connection-1', 
        runtime: { version: 'stable' } 
    });
    const app: OpenFin.Application = await fin.Application.start({...});
})()

Further Reading

License

Copyright 2020-2023 OpenFin

The code in this package is distributed under the Apache License, Version 2.0.

However, if you run this code, it may call on the OpenFin RVM or OpenFin Runtime, which are covered by OpenFin's Developer, Community, and Enterprise licenses. You can learn more about OpenFin licensing at the links listed below or email us at support@openfin.co with questions.

38.81.49

3 days ago

38.81.48

5 days ago

38.81.46

7 days ago

38.81.47

6 days ago

38.81.44

10 days ago

38.81.42

11 days ago

38.81.41

12 days ago

38.81.40

13 days ago

38.81.39

14 days ago

37.81.22

18 days ago

38.81.37

18 days ago

37.81.21

19 days ago

38.81.34

20 days ago

37.81.20

20 days ago

38.81.32

24 days ago

38.81.31

25 days ago

36.80.11

27 days ago

38.81.29

27 days ago

38.81.30

26 days ago

37.81.19

1 month ago

36.80.10

1 month ago

38.81.19

1 month ago

38.81.22

1 month ago

38.81.23

1 month ago

38.81.24

1 month ago

36.80.9

2 months ago

34.78.83

2 months ago

36.80.6

2 months ago

36.80.7

2 months ago

36.80.8

2 months ago

34.78.82

2 months ago

34.78.81

2 months ago

36.80.5

2 months ago

36.80.4

2 months ago

36.80.3

3 months ago

36.80.2

3 months ago

36.80.1

3 months ago

37.80.39

3 months ago

37.80.38

3 months ago

37.80.36

3 months ago

37.80.35

3 months ago

37.80.34

3 months ago

37.80.33

3 months ago

37.80.25

4 months ago

34.78.80

4 months ago

37.80.24

4 months ago

37.80.23

4 months ago

35.79.5

4 months ago

34.78.79

4 months ago

37.80.21

4 months ago

37.80.20

4 months ago

34.78.78

4 months ago

37.80.19

4 months ago

36.79.19

4 months ago

37.80.17

4 months ago

37.80.18

4 months ago

37.80.16

4 months ago

37.80.15

4 months ago

37.80.13

4 months ago

37.80.12

4 months ago

37.80.11

4 months ago

37.80.10

4 months ago

35.79.4

4 months ago

37.80.9

4 months ago

34.78.77

4 months ago

37.80.8

4 months ago

37.80.7

4 months ago

37.80.6

5 months ago

37.80.5

5 months ago

37.80.3

5 months ago

37.80.4

5 months ago

34.78.76

5 months ago

36.79.18

5 months ago

35.79.3

5 months ago

34.78.75

5 months ago

36.79.17

5 months ago

36.79.15

5 months ago

35.79.2

5 months ago

36.79.13

5 months ago

36.79.12

5 months ago

36.79.11

5 months ago

34.78.74

5 months ago

36.79.10

5 months ago

36.79.9

5 months ago

35.79.1

5 months ago

33.77.12

5 months ago

34.78.73

5 months ago

34.78.69

5 months ago

36.79.4

5 months ago

36.79.5

5 months ago

36.79.3

5 months ago

34.78.67

5 months ago

36.79.1

6 months ago

35.78.3

6 months ago

36.78.22

6 months ago

34.78.66

6 months ago

36.78.21

6 months ago

36.78.19

6 months ago

36.78.18

6 months ago

36.78.17

6 months ago

36.78.14

6 months ago

36.78.13

6 months ago

34.78.65

6 months ago

36.78.11

6 months ago

36.78.10

6 months ago

36.78.9

6 months ago

36.78.8

6 months ago

36.78.7

6 months ago

36.78.6

6 months ago

36.78.5

6 months ago

36.78.4

6 months ago

36.78.3

6 months ago

36.78.2

6 months ago

36.78.1

6 months ago

34.78.63

6 months ago

35.78.9

7 months ago

35.78.8

7 months ago

35.78.7

7 months ago

35.78.4

7 months ago

33.77.11

7 months ago

34.78.62

7 months ago

35.78.29

7 months ago

35.78.27

7 months ago

34.78.61

7 months ago

35.78.26

7 months ago

34.78.60

7 months ago

35.78.23

7 months ago

35.78.22

7 months ago

35.78.21

7 months ago

34.78.58

7 months ago

33.77.10

7 months ago

35.78.20

7 months ago

34.78.57

7 months ago

35.78.19

7 months ago

35.78.18

7 months ago

35.78.17

7 months ago

35.78.16

7 months ago

35.78.15

8 months ago

34.78.56

8 months ago

35.78.14

8 months ago

35.78.12

8 months ago

35.78.11

8 months ago

33.77.9

8 months ago

34.78.54

8 months ago

35.78.6

8 months ago

35.78.5

8 months ago

34.78.53

8 months ago

34.78.52

8 months ago

35.78.2

8 months ago

35.78.1

8 months ago

34.78.51

8 months ago

33.77.8

8 months ago

34.78.8

9 months ago

34.78.6

9 months ago

34.78.4

9 months ago

34.78.50

9 months ago

33.77.6

9 months ago

34.78.49

9 months ago

34.78.48

9 months ago

34.78.47

9 months ago

34.78.45

9 months ago

34.78.43

9 months ago

34.78.42

9 months ago

34.78.38

9 months ago

34.78.37

9 months ago

34.78.34

10 months ago

34.78.33

10 months ago

34.78.32

10 months ago

34.78.31

10 months ago

34.78.30

10 months ago

34.78.29

10 months ago

33.77.2

10 months ago

34.78.28

10 months ago

34.78.27

10 months ago

34.78.26

10 months ago

34.78.25

10 months ago

34.78.23

10 months ago

34.78.22

10 months ago

34.78.21

10 months ago

34.78.20

10 months ago

34.78.19

10 months ago

34.78.18

10 months ago

34.78.17

10 months ago

34.78.16

10 months ago

34.78.15

10 months ago

34.78.14

10 months ago

34.78.13

11 months ago

34.78.12

11 months ago

34.78.11

11 months ago

34.78.10

11 months ago

34.78.9

11 months ago

34.78.7

11 months ago

34.78.5

11 months ago

34.78.3

11 months ago

34.78.2

11 months ago

34.78.1

11 months ago

33.77.7

11 months ago

33.77.5

11 months ago

33.77.4

11 months ago

33.77.3

11 months ago

33.77.1

11 months ago

33.76.38

11 months ago

33.76.36

12 months ago