Skip to content
Snippets Groups Projects

Use webpack for bundling JS libs and move Golang code related to Iframe generation there

Merged Igor Markin requested to merge feature-vcl-webpack-bundle into master
1 file
+ 43
0
Compare changes
  • Side-by-side
  • Inline
+ 43
0
@@ -3,6 +3,49 @@
Vereign’s JavaScript library is an asynchronous library that allows for digitally signing your email and in-browser documents, data encryption, and key-based authentication.
## Usage
Add library as inline script.
```html
<script type="text/javascript" src="./viamapi-client.js"/>
```
Initialize library
```js
// Target container used to append iframe
const containerId = "root";
// Required methods used to be called within iframe.
const methods = {
onEvent(event) { console.log(event) }
};
// Iframe URL to connect
const iframeUrl = "https://test.org/iframe";
// API url used to access endpoints
const apiUrl = "https://test.org/api";
this.library = setupViamAPI(containerId, methods, iframeUrl, apiUrl);
this.library.then(lib => {
this.listenerUUID = this.addListener({
callback: function(event) {
handleEvent(event);
},
filters: [
"IdentityNotLoaded",
"ActionConfirmedAndExecuted",
"Authenticated"
]
});
lib.listIdentities().then(response => {
this.setState({ identities: response.data });
});
});
```
## Development
### Running
Loading