@hellena-sdk/hellena 1.0.1 → 1.0.2

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 +20 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,20 +1,35 @@
1
- # hellena-JavaScript-SDK
1
+ # hellena-SDK
2
2
 
3
3
  A JavaScript SDK for the Hellena platform.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install hellena-javascript-sdk
8
+ npm i @hellena-sdk/hellena
9
9
  ```
10
10
 
11
11
  ## Usage
12
12
 
13
13
  ```javascript
14
- const Hellena = require('hellena-javascript-sdk');
14
+ import { HellenaClient } from "@hellena-sdk/hellena";
15
+ import dotenv from "dotenv";
15
16
 
16
- const client = new Hellena({
17
- apiKey: 'your-api-key'
17
+ dotenv.config({ quiet: true });
18
+
19
+ const main = async () => {
20
+ const hellena = new HellenaClient(process.env.HELLENA_API_KEY!);
21
+
22
+ const product = await hellena.product.findOne({
23
+ id: "123"
24
+ })
25
+
26
+ return product
27
+ }
28
+
29
+ main().then((data) => {
30
+ console.log(data.barcode, data.name, data.quantity);
31
+ }).catch((error) => {
32
+ console.error("An error occurred:", error);
18
33
  });
19
34
  ```
20
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hellena-sdk/hellena",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {