@sawport/react-sdk 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/dist/index.es.js +26283 -0
- package/dist/index.umd.js +129 -0
- package/dist/style.css +6 -0
- package/package.json +82 -0
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Getting Started Sawport Widget
|
|
2
|
+
|
|
3
|
+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
### Pull the javascript and css into your webpage.
|
|
7
|
+
```html
|
|
8
|
+
<html>
|
|
9
|
+
<head>
|
|
10
|
+
<link href="https://{WIDGET_HOST_DOMAIN}/widget/index.css" rel="stylesheet" />
|
|
11
|
+
<script src="https://{WIDGET_HOST_DOMAIN}/widget/index.js"></script>
|
|
12
|
+
...
|
|
13
|
+
```
|
|
14
|
+
### Put the widget into a container class of `sawport-widget`
|
|
15
|
+
```html
|
|
16
|
+
...
|
|
17
|
+
<div class='sawport-widget' />
|
|
18
|
+
</body>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Setting up enterprise credentials
|
|
22
|
+
call the gloabl function `setSawportConfig` to set the enterprise credential.
|
|
23
|
+
```js
|
|
24
|
+
document.ready(function (){
|
|
25
|
+
window.setSawportConfig({
|
|
26
|
+
projectId: XXXXXXXXXXXXXX,
|
|
27
|
+
user: {email: 'example@emai.lcom'}
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Available Scripts
|
|
33
|
+
|
|
34
|
+
In the project directory, you can run:
|
|
35
|
+
|
|
36
|
+
### `yarn start`
|
|
37
|
+
|
|
38
|
+
Runs the app in the development mode.\
|
|
39
|
+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
|
40
|
+
|
|
41
|
+
The page will reload if you make edits.\
|
|
42
|
+
You will also see any lint errors in the console.
|
|
43
|
+
|
|
44
|
+
### `yarn test`
|
|
45
|
+
|
|
46
|
+
Launches the test runner in the interactive watch mode.\
|
|
47
|
+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
48
|
+
|
|
49
|
+
### `yarn build`
|
|
50
|
+
|
|
51
|
+
Builds the app for production to the `build` folder.\
|
|
52
|
+
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
53
|
+
|
|
54
|
+
The build is minified and the filenames include the hashes.\
|
|
55
|
+
Your app is ready to be deployed!
|
|
56
|
+
|
|
57
|
+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|