https://github.com/chainpoint/chainpoint-client-web
https://github.com/chainpoint/chainpoint-client-web
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chainpoint/chainpoint-client-web
- Owner: chainpoint
- License: apache-2.0
- Created: 2018-08-14T20:16:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T23:12:50.000Z (over 7 years ago)
- Last Synced: 2025-10-19T13:50:55.498Z (8 months ago)
- Language: JavaScript
- Size: 7.84 MB
- Stars: 4
- Watchers: 7
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chainpoint-client-web
[](https://travis-ci.com/chainpoint/chainpoint-client-web)
## About
This library provides react components for creating and verifying [Chainpoint](https://chainpoint.org) proofs using the [Chainpoint](https://chainpoint.org) Network.
### Overview
There are multiple ways to embed the UI components into the site.
**NPM**
```bash
npm i --save chainpoint-client-web
```
**YARN**
```bash
yarn add chainpoint-client-web
```
**CDN**
The latest javascript and css files are available at https://web-client.chainpoint.org/latest.js and https://web-client.chainpoint.org/latest.css. You can also pin to a specific version by using the short sha1 from that particular release in the format https://web-client.chainpoint.org/chainpoint-client-web.SHORT_SHA1.js.
Three different fonts are being used by this component: 1) Source Sans Pro, 2) PT Mono, 3) Lato. Each of these fonts are available via CDN. Remember to include these Font files in the of your HTML page.
```
```
### HTML tag
chainpoint-client-web provides two files for use in html pages:
- _node_modules/chainpoint-client-web/dist/bundle.js_
- _node_modules/chainpoint-client-web/dist/bundle.css_
Steps:
- Create _script_ and _link_ tag for bundled css and js files.
- Add a container with id **chainpoint-client-web**.
The Chainpoint client will render application directly in this container.
```js
function onAppearCreate() {
console.log('onAppearCreate');
}
function onAppearVerify() {
console.log('onAppearVerify');
}
function onChangeProofCount() {
console.log('onChangeProofCount');
}
function onChangeCreateStatus() {
console.log('onChangeCreateStatus');
}
function onChangeVerifyFailStatus() {
console.log('onChangeVerifyFailStatus');
}
function onChangeVerifySuccessStatus() {
console.log('onChangeVerifySuccessStatus');
}
function onChangeVerifyAnalysisStatus() {
console.log('onChangeVerifyAnalysisStatus');
}
```
### Attrs
- data-onAppearCreate
- data-onAppearVerify
- data-onChangeProofCount
- data-onChangeCreateStatus
- data-onChangeVerifyFailStatus
- data-onChangeVerifySuccessStatus
- data-onChangeVerifyAnalysisStatus
### React Components
chainpoint-client-web provides set of react components for use in react application:
- _node_modules/chainpoint-client-web/dist/react_
```js
import ProofClient from 'chainpoint-client-web/dist/react/index.js'
import 'chainpoint-client-web/dist/react/index.css'
export default props => (
{}}
onAppearVerify={() => {}}
onChangeProofCount={() => {}}
onChangeCreateStatus={() => {}}
onChangeVerifyAnalysisStatus={() => {}}
onChangeVerifySuccessStatus={() => {}}
onChangeVerifyFailStatus={() => {}}
/>
)
```
#### Props:
- onAppearCreate
- onAppearVerify
- onChangeProofCount
- onChangeCreateStatus
- onChangeVerifyFailStatus
- onChangeVerifySuccessStatus
- onChangeVerifyAnalysisStatus