@artaio/arta-browser 2.3.2 → 2.3.4

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.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -34,3 +34,29 @@ And you can then import `Arta` object for example:
34
34
  ```js
35
35
  import Arta from '@artaio/arta-browser';
36
36
  ```
37
+
38
+ ### Basic Usage
39
+ ```jsx
40
+ import Arta from '@artaio/arta-browser';
41
+
42
+ // On load
43
+ Arta.init('<YOUR_API_KEY>');
44
+ ... // Your code
45
+
46
+ // On widget display
47
+ const estimate = Arta.estimate({origin, objects}, config); // check types for more details
48
+ await esimate.validate(); // mandatory for setting estimate.isReady
49
+
50
+ // estimate.open() will render the widget
51
+ esimate.isRead && <Button onClick={() => estimate.open()}>
52
+ ```
53
+ For more details and examples using different frontend frameworks please check https://github.com/artaio/arta-browser-examples .
54
+
55
+ ## Contributing
56
+
57
+ Please ensure that all the examples available on https://github.com/artaio/arta-browser-examples are still working before opening a PR.
58
+
59
+ ### Development
60
+ To develop a new function on the SDK, run `npm install` to install all the dependencies and then run `npm run build` and the compiled JS code will be stored in the `dist/` folder which is the folder with the content published to NPM.
61
+
62
+ Please be aware that the current CI setup publishes both the compiled JS code and the bundled version. Then, we use https://www.jsdelivr.com/ to distribute the bundled version stored in NPM.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artaio/arta-browser",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "",
5
5
  "source": "lib/index.ts",
6
6
  "main": "./dist/index.js",