Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Commits
2863feb3
Commit
2863feb3
authored
6 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Add usage examples
parent
6f0133fe
No related branches found
No related tags found
1 merge request
!4
Use webpack for bundling JS libs and move Golang code related to Iframe generation there
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+43
-0
43 additions, 0 deletions
README.md
with
43 additions
and
0 deletions
README.md
+
43
−
0
View file @
2863feb3
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment