Skip to content

Commit c1d3855

Browse files
authored
Merge pull request #43 from onfido/improvement/better-documentation-for-import-usage
changed documentation and added a jsfiddle link
2 parents f6ad451 + b69917a commit c1d3855

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,31 @@ From left to right:
2424

2525
To get up and running with the library, there are three things you need to include.
2626

27-
### 1. The script and styles
27+
### 1. Include/Import the library
28+
29+
#### 1.1 HTML Script Tag Include
2830

2931
Include it as a regular script tag on your page:
3032

3133
```html
3234
<script src='dist/onfido.min.js'></script>
3335
```
3436

35-
Or import it as a module into your own JS build system:
37+
And the CSS styles:
38+
39+
```html
40+
<link rel='stylesheet' href='dist/styles.css'>
41+
```
42+
43+
#### Example app
44+
45+
[Here](https://jsfiddle.net/4xqtt6fL/3/)
46+
you can see a simple example using script tags.
47+
48+
#### 1.2 NPM style import
49+
50+
You can also import it as a module into your own JS build system.
51+
3652

3753
```sh
3854
$ npm install --save onfido-sdk-ui
@@ -46,11 +62,16 @@ import Onfido from 'onfido-sdk-ui'
4662
var Onfido = require('onfido-sdk-ui')
4763
```
4864

49-
And finally, the CSS styles:
65+
The **CSS style** will be included **inline with the JS code** if the library is imported.
5066

51-
```html
52-
<link rel='stylesheet' href='dist/styles.css'>
53-
```
67+
#### Notice
68+
69+
The library is **Browser only**, it does not support the **Node Context**.
70+
71+
#### Example App
72+
73+
**[Here](https://github.com/onfido/onfido-sdk-web-sample-app/tree/0.0.1)**
74+
you can see an example app which uses the npm style of import.
5475

5576
### 2. Some markup
5677

0 commit comments

Comments
 (0)