@enaio-client/communication-library v2.0.2-rc4
@enaio-client/communication-library
Description
The Communication Library facilitates secure cross-origin communication between the enaio® webclient and dashlets/modal dialogs, using window.postMessage()
. This library streamlines the process, ensuring compatibility with the enaio® client, and offers an effortless solution for managing postMessage
communication, enhancing the usability and interoperability of your applications.
Installation
In a Node.js Project
npm install @enaio-client/communication-library
In a Browser Project
Include the library directly in your HTML file:
<script src="path/to/communication-library/dist/communication-library.js"></script>
Usage
In a Node.js Environment
Import the library using CommonJS or ES6 module syntax:
CommonJS:
const lib = require('@enaio-client/communication-library');
ES6:
import * as lib from '@enaio-client/communication-library';
In a Browser Environment
Access the library using the global variable defined in your build configuration:
var lib = window.CommunicationLibrary;
Examples
Register Initialization Callback
lib.registerOnInitCallback(onInit);
function onInit(data) {
// Initialization logic here
}
Open Index Data
async function openIndexData() {
try {
await lib.openIndexData(false, 'edit', 'objectId');
} catch (error) {
console.error(error);
}
}
Building the Package
To build the package, run:
npm run build
This will generate a bundled file in the dist
folder.
Testing
To test the package, run:
npm test
This will execute tests defined in your karma.conf.js
file.
Repository
Keywords
- optimal-systems
- enaio
- communication-library
License
This project is licensed under the ISC License.
11 months ago
1 year ago
11 months ago
10 months ago
10 months ago
10 months ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago