@leatcom/portal-sessions 0.0.23

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 +43 -0
  2. package/package.json +80 -0
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Portal Sessions by Leat|Piggy
2
+
3
+ This is the Javascript SDK for integrating with Leat|Piggy using Portal Sessions. Sign up for a free Leat|Piggy account [here](https://business.piggy.eu/sign-up).
4
+
5
+ More information on Portal Sessions and their specific API calls can be found on the [API Documentation](https://docs.piggy.eu/v3/oauth/portal-sessions).
6
+
7
+ ## Installation
8
+
9
+ Install using
10
+ ```
11
+ npm install portal-sessions
12
+ ```
13
+ ```
14
+ yarn add portal-sessions
15
+ ```
16
+
17
+ ## Documentation
18
+
19
+ * [API Documentation & Reference](https://docs.piggy.eu)
20
+
21
+
22
+ ## Usage
23
+
24
+ Portal Sessions come in different types, each with their own use. To initiate a Portal Sessions, an API key is required, which can be created in your [account's Dashboard](https://business.piggy.eu). A Portal Session is also always created for a specific `Shop`, so the `shopUuid` is also required. You can find a Shop's UUID in your [Dashboard](https://business.piggy.eu/settings/shop-management/shops?tab=profiles) or by [API](https://docs.piggy.eu/v3/oauth/shops).
25
+
26
+ Currently, there are five Portal Session types:
27
+ * `PORTAL`: This is the 'default' session type, which doesn't have a predefined aim, but rather allows for flexible use. See this as a way for customers to login to their own portal.
28
+ * `REDEEM_GIFTCARD`: A session to use and redeem gift card(s). Best used as payment option.
29
+ * `TOP_UP_GIFTCARD`: A session to sell and/or top up existing gift cards.
30
+ * `PREPAID`: A session to handle prepaid transactions.
31
+ * `SAVE`: A session to handle an order and a subsequent credit reception.
32
+ * `VOUCHER`: A session to redeem vouchers.
33
+
34
+ Initiate a new Portal Session as follows:
35
+ ```
36
+ <PortalSession
37
+ apiKey={apiKey}
38
+ shopUuid={shopUuid}
39
+ type="PORTAL"
40
+ scannerType="camera"
41
+ onRedeemVoucher={(voucher) => handleVoucherLogic(voucher)}
42
+ />
43
+ ```
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@leatcom/portal-sessions",
3
+ "version": "0.0.23",
4
+ "type": "module",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/main.d.ts",
12
+ "default": "./dist/portal-sessions.es.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/main.d.ts",
16
+ "default": "./dist/portal-sessions.umd.js"
17
+ }
18
+ },
19
+ "./dist/style.css": "./dist/style.css"
20
+ },
21
+ "module": "./dist/portal-sessions.es.js",
22
+ "scripts": {
23
+ "start": "vite",
24
+ "build:development": "tsc && vite build --mode staging",
25
+ "build:production": "tsc && vite build --mode production",
26
+ "preview": "vite preview",
27
+ "publish-to-registry": "yarn build:production && yarn publish --patch --network-timeout 600000 && git push",
28
+ "test": "vitest --environment=jsdom",
29
+ "link-local": "yarn link && cd node_modules/react && yarn link && cd ../react-dom && yarn link",
30
+ "unlink-local": "yarn unlink && cd node_modules/react && yarn unlink && cd ../react-dom && yarn unlink"
31
+ },
32
+ "dependencies": {
33
+ "axios": "^1.7.1",
34
+ "classnames": "^2.5.1",
35
+ "i18next": "^23.11.5",
36
+ "i18next-browser-languagedetector": "^8.0.0",
37
+ "i18next-http-backend": "^2.5.2",
38
+ "moment": "^2.30.1",
39
+ "qr-scanner": "^1.4.2",
40
+ "react-simple-keyboard": "^3.7.121",
41
+ "react-spring": "^9.7.3",
42
+ "react-toastify": "^10.0.5",
43
+ "swr": "^2.2.5"
44
+ },
45
+ "peerDependencies": {
46
+ "react": "16.8.0 || >=17.x",
47
+ "react-dom": "16.8.0 || >=17.x"
48
+ },
49
+ "devDependencies": {
50
+ "@nabla/vite-plugin-eslint": "2.0.4",
51
+ "@testing-library/react": "^15.0.7",
52
+ "@types/node": "20.12.12",
53
+ "@types/react": "18.3.2",
54
+ "@types/react-dom": "18.3.0",
55
+ "@typescript-eslint/eslint-plugin": "7.10.0",
56
+ "@typescript-eslint/parser": "7.10.0",
57
+ "@vitejs/plugin-react": "^4.2.1",
58
+ "autoprefixer": "10.4.19",
59
+ "eslint": "9.3.0",
60
+ "eslint-config-prettier": "9.1.0",
61
+ "eslint-plugin-prettier": "5.1.3",
62
+ "eslint-plugin-react": "7.34.1",
63
+ "eslint-plugin-react-hooks": "4.6.2",
64
+ "jsdom": "^24.0.0",
65
+ "postcss": "8.4.38",
66
+ "prettier": "3.2.5",
67
+ "prettier-plugin-tailwindcss": "0.5.14",
68
+ "react": "18.3.1",
69
+ "react-dom": "18.3.1",
70
+ "react-i18next": "^14.1.0",
71
+ "react-router-dom": "^6.22.2",
72
+ "sass": "^1.71.1",
73
+ "tailwindcss": "3.4.3",
74
+ "typescript": "^5.4.5",
75
+ "vite": "^5.2.11",
76
+ "vite-plugin-dts": "^3.8.1",
77
+ "vite-tsconfig-paths": "^4.3.1",
78
+ "vitest": "^1.4.0"
79
+ }
80
+ }