@swirepay-developer/sparo-embed-sdk 1.0.2 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.4
4
+
5
+ - Target release for gateway npm install (`@swirepay/sparo-embed-sdk@^1.0.4`).
6
+ - Includes publish pipeline fixes and correct `dist/index.js` / `dist/index.mjs` entry points.
7
+
8
+ ## 1.0.1
9
+
10
+ - Fix package entry points (`main` / `exports`) to match build output (`dist/index.js`, `dist/index.mjs`).
11
+ - Add `publishConfig` for scoped npm publish (`restricted`).
12
+ - Remove `prepare: husky` so installing the published package does not run husky on gateway machines.
13
+ - Add [DEVOPS-NPM-PUBLISH.md](./DEVOPS-NPM-PUBLISH.md) and [bitbucket-pipelines.yml](./bitbucket-pipelines.yml) for Bitbucket → npm workflow.
14
+ - Point `repository` to Bitbucket (`zetametrics/sparo-swirepay-frontend`).
15
+
3
16
  ## 1.0.0
4
17
 
5
18
  - Introduced `embed(options)` SDK API aligned with SPARO guest-token backend flow.
6
19
  - Added iframe lifecycle handling, origin-pinned `postMessage` auth, and token auto-refresh.
7
20
  - Added `SPARO-EMBEDDING.md` integration guide for consumer applications.
8
21
  - Prepared package for distribution with `dist` outputs (CJS, ESM, browser global).
9
-
@@ -0,0 +1,435 @@
1
+ # Gateway Frontend — SPARO SDK Integration Guide (React)
2
+
3
+ Step-by-step guide for **gateway-frontend** React developers integrating `@swirepay/sparo-embed-sdk` from npm.
4
+
5
+ > **Prerequisite:** DevOps must publish the SDK from Bitbucket first.
6
+ > Repo: https://bitbucket.org/zetametrics/sparo-swirepay-frontend.git — runbook: [DEVOPS-NPM-PUBLISH.md](./DEVOPS-NPM-PUBLISH.md)
7
+ >
8
+ > **`Module not found: Can't resolve '@swirepay/sparo-embed-sdk'`** means the package is **not on npm** (or not installed). Ask DevOps to run `npm view @swirepay/sparo-embed-sdk version` — if **404**, publish is still pending. Your `SparoChat` code can be correct and this error will still appear.
9
+
10
+ ---
11
+
12
+ ## What you are building
13
+
14
+ ```text
15
+ User (logged into gateway)
16
+ → React page (SparoChat)
17
+ → SDK calls YOUR backend: GET /sparo/token
18
+ → YOUR backend calls SPARO: POST /api/guest-token (SPARO_ADMIN_KEY)
19
+ → SDK receives { token, expiresIn, account }
20
+ → SDK loads SPARO iframe + sends JWT via postMessage
21
+ → SPARO chat UI renders (no SPARO login screen)
22
+ ```
23
+
24
+ You do **not** implement iframe auth yourself — the SDK handles iframe creation, `postMessage`, and token refresh.
25
+
26
+ ---
27
+
28
+ ## Prerequisites
29
+
30
+ Before starting, confirm with your team:
31
+
32
+ | Item | Owner | Notes |
33
+ |------|--------|-------|
34
+ | npm access to `@swirepay/sparo-embed-sdk` | DevOps / npm org | `npm login` if private scope |
35
+ | `SPARO_ADMIN_KEY` | Backend | Never in React code or `.env` with `REACT_APP_` |
36
+ | Merchant enabled in SPARO | SPARO admin | Deny-by-default allowlist |
37
+ | Backend route `/sparo/token` | Backend | Returns guest JWT for logged-in user |
38
+ | SPARO environment URL | Config | Staging vs production `sparoDomain` |
39
+
40
+ ---
41
+
42
+ ## Step 1 — Install the SDK
43
+
44
+ From the **gateway-frontend** project root:
45
+
46
+ ```bash
47
+ npm install @swirepay/sparo-embed-sdk
48
+ ```
49
+
50
+ Or add to `package.json`:
51
+
52
+ ```json
53
+ {
54
+ "dependencies": {
55
+ "@swirepay/sparo-embed-sdk": "^1.0.4"
56
+ }
57
+ }
58
+ ```
59
+
60
+ Then:
61
+
62
+ ```bash
63
+ npm install
64
+ ```
65
+
66
+ ### Verify install
67
+
68
+ ```bash
69
+ npm ls @swirepay/sparo-embed-sdk
70
+ ```
71
+
72
+ You should see the package listed. If not:
73
+
74
+ - Run `npm login` (private `@swirepay` scope)
75
+ - Remove any old `"file:..."` path dependency for this package
76
+ - Delete `node_modules` and `package-lock.json`, then `npm install` again
77
+
78
+ ---
79
+
80
+ ## Step 2 — Environment variables (frontend)
81
+
82
+ Add **non-secret** config only. Never put `SPARO_ADMIN_KEY` in React env vars.
83
+
84
+ ### `.env.development` (local / dev)
85
+
86
+ ```env
87
+ REACT_APP_SPARO_DOMAIN=https://sparo-staging.swirepay.com
88
+ ```
89
+
90
+ ### `.env.production`
91
+
92
+ ```env
93
+ REACT_APP_SPARO_DOMAIN=https://sparo.swirepay.com
94
+ ```
95
+
96
+ Use the URL your team provides for each environment.
97
+ `sparoDomain` must match the environment your **backend** uses when minting tokens.
98
+
99
+ ---
100
+
101
+ ## Step 3 — Backend contract (coordinate with backend team)
102
+
103
+ Your React app will call **your** API, not SPARO directly.
104
+
105
+ ### Required endpoint (example)
106
+
107
+ `GET /sparo/token` (or `/api/sparo/token` — match your gateway API prefix)
108
+
109
+ **Request**
110
+
111
+ - Authenticated user session (cookie or Bearer — same as rest of gateway)
112
+ - `credentials: 'include'` if cookie-based
113
+
114
+ **Response `200`**
115
+
116
+ ```json
117
+ {
118
+ "token": "eyJhbGciOi...",
119
+ "expiresIn": 900,
120
+ "account": "account-72ec92..."
121
+ }
122
+ ```
123
+
124
+ | Field | Meaning |
125
+ |-------|---------|
126
+ | `token` | Short-lived guest JWT from SPARO |
127
+ | `expiresIn` | Seconds until expiry (e.g. 900 = 15 min) |
128
+ | `account` | Merchant account GID for this user |
129
+
130
+ **Important:** `account` must be the merchant the logged-in user belongs to. Backend resolves it from session/DB — frontend must not let users pick arbitrary merchant IDs.
131
+
132
+ ### Error responses to handle in UI
133
+
134
+ | HTTP | Meaning | Suggested UI |
135
+ |------|---------|----------------|
136
+ | 401 | User not logged in | Redirect to login |
137
+ | 403 | `merchant_not_enabled` | “Contact us” / support message |
138
+ | 429 | Rate limited | Retry message |
139
+ | 500 | Mint failed | Generic error + support |
140
+
141
+ ---
142
+
143
+ ## Step 4 — Create the React page component
144
+
145
+ Create a route component, e.g. `src/routes/SparoChat/index.js`:
146
+
147
+ ```jsx
148
+ import React, { useEffect, useRef, useState } from 'react';
149
+ import { embed } from '@swirepay/sparo-embed-sdk';
150
+
151
+ const SPARO_DOMAIN = process.env.REACT_APP_SPARO_DOMAIN || 'https://sparo.swirepay.com';
152
+
153
+ export default function SparoChat() {
154
+ const mountRef = useRef(null);
155
+ const handleRef = useRef(null);
156
+ const [error, setError] = useState(null);
157
+ const [ready, setReady] = useState(false);
158
+
159
+ useEffect(() => {
160
+ const el = mountRef.current;
161
+ if (!el) return undefined;
162
+
163
+ setError(null);
164
+ setReady(false);
165
+
166
+ handleRef.current = embed({
167
+ id: 'sparo-chat',
168
+ sparoDomain: SPARO_DOMAIN,
169
+ mountPoint: el,
170
+ fetchGuestToken: async () => {
171
+ const res = await fetch('/sparo/token', {
172
+ credentials: 'include',
173
+ });
174
+ if (res.status === 401) {
175
+ window.location.href = '/login';
176
+ throw new Error('Unauthorized');
177
+ }
178
+ if (!res.ok) {
179
+ const body = await res.json().catch(() => ({}));
180
+ const err = new Error(body.error || 'Failed to fetch SPARO token');
181
+ err.code = body.code || 'fetch_failed';
182
+ throw err;
183
+ }
184
+ return res.json();
185
+ },
186
+ uiConfig: {
187
+ theme: 'light',
188
+ showWelcome: true,
189
+ showSuggestions: true,
190
+ hideSidebar: false,
191
+ },
192
+ onReady: () => setReady(true),
193
+ onError: (err) => {
194
+ console.error('[SPARO]', err.code, err.message);
195
+ setError(err.message || 'SPARO failed to load');
196
+ },
197
+ });
198
+
199
+ return () => {
200
+ if (handleRef.current) {
201
+ handleRef.current.unmount();
202
+ handleRef.current = null;
203
+ }
204
+ };
205
+ }, []);
206
+
207
+ return (
208
+ <div style={{ padding: 16 }}>
209
+ <h1>SPARO Assistant</h1>
210
+ {ready && !error && (
211
+ <p style={{ color: '#389e0d', fontSize: 13 }}>Connected</p>
212
+ )}
213
+ {error && (
214
+ <p style={{ color: '#cf1322' }} role="alert">
215
+ {error}
216
+ </p>
217
+ )}
218
+ <div
219
+ ref={mountRef}
220
+ style={{
221
+ width: '100%',
222
+ height: '720px',
223
+ minHeight: 480,
224
+ border: '1px solid #e8e8e8',
225
+ borderRadius: 8,
226
+ }}
227
+ />
228
+ </div>
229
+ );
230
+ }
231
+ ```
232
+
233
+ ### If your API base URL is not same-origin
234
+
235
+ Use your existing axios instance or API helper:
236
+
237
+ ```js
238
+ import { axiosAuthInstance, API_END_POINTS } from 'api';
239
+
240
+ fetchGuestToken: async () => {
241
+ const { data } = await axiosAuthInstance.get('/sparo/token');
242
+ return data;
243
+ },
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Step 5 — Register the route
249
+
250
+ Add a protected route in your router config (example for React Router v5):
251
+
252
+ ```js
253
+ import SparoChat from 'routes/SparoChat';
254
+
255
+ // In routes array:
256
+ {
257
+ key: 'sparo',
258
+ path: '/sparo',
259
+ exact: true,
260
+ protected: true,
261
+ component: SparoChat,
262
+ allowedRoles: [/* same roles as your team allows */],
263
+ }
264
+ ```
265
+
266
+ Add a nav link or header icon that navigates to `/sparo`.
267
+
268
+ Restart the dev server after adding the route:
269
+
270
+ ```bash
271
+ npm start
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Step 6 — Test locally
277
+
278
+ 1. Log in to gateway as a user tied to an **enabled** merchant.
279
+ 2. Open `/sparo`.
280
+ 3. Open DevTools → **Network**:
281
+ - Confirm `GET /sparo/token` returns `200` with `token`, `expiresIn`, `account`.
282
+ 4. Open DevTools → **Console**:
283
+ - No `Module not found` for `@swirepay/sparo-embed-sdk`.
284
+ 5. Confirm iframe loads (Elements tab → `iframe` under your mount div).
285
+ 6. SPARO UI should appear without a SPARO login page.
286
+
287
+ ### Staging vs production
288
+
289
+ | Environment | `REACT_APP_SPARO_DOMAIN` | Backend mint URL |
290
+ |-------------|--------------------------|------------------|
291
+ | Staging | Staging SPARO host | Same SPARO env as domain |
292
+ | Production | `https://sparo.swirepay.com` (or prod host) | Production SPARO API |
293
+
294
+ Mismatch (staging token + production domain) causes auth failures.
295
+
296
+ ---
297
+
298
+ ## Step 7 — SDK API reference (what you pass)
299
+
300
+ ### `embed(options)`
301
+
302
+ | Option | Required | Description |
303
+ |--------|----------|-------------|
304
+ | `sparoDomain` | Yes | SPARO host, e.g. `https://sparo.swirepay.com` |
305
+ | `mountPoint` | Yes | DOM element (use `ref.current`) |
306
+ | `fetchGuestToken` | Yes | Async function returning `{ token, expiresIn, account }` |
307
+ | `id` | No | iframe id (default `sparo-embed`) |
308
+ | `uiConfig` | No | Theme and UI flags (see below) |
309
+ | `onReady` | No | Called when iframe signals ready |
310
+ | `onError` | No | Called on token/iframe errors |
311
+
312
+ ### `uiConfig` (optional)
313
+
314
+ ```js
315
+ {
316
+ theme: 'light', // 'light' | 'dark'
317
+ showWelcome: true,
318
+ showSuggestions: true,
319
+ hideSidebar: false,
320
+ }
321
+ ```
322
+
323
+ ### Return value
324
+
325
+ ```js
326
+ const handle = embed({ ... });
327
+
328
+ handle.refresh(); // manually refresh token (usually not needed)
329
+ handle.unmount(); // cleanup — call on route leave (useEffect return)
330
+ ```
331
+
332
+ Token refresh is **automatic** ~30 seconds before expiry.
333
+
334
+ ---
335
+
336
+ ## Step 8 — Security checklist (frontend)
337
+
338
+ - Do not store `SPARO_ADMIN_KEY` in frontend.
339
+ - Do not put guest `token` in URL query params.
340
+ - Do not hardcode production tokens in source.
341
+ - Always use `credentials: 'include'` if session is cookie-based.
342
+ - Always `unmount()` when leaving the page (see `useEffect` cleanup).
343
+ - Size the mount container with CSS (`height: 720px` or full viewport).
344
+
345
+ ---
346
+
347
+ ## Troubleshooting
348
+
349
+ ### `Module not found: Can't resolve '@swirepay/sparo-embed-sdk'`
350
+
351
+ Webpack shows this when the package is **not installed** under `node_modules` (install failed or was never run).
352
+
353
+ **Step 0 — verify the package exists on your registry**
354
+
355
+ From `gateway-frontend`:
356
+
357
+ ```bash
358
+ npm view @swirepay/sparo-embed-sdk version
359
+ ```
360
+
361
+ | Result | Meaning |
362
+ |--------|---------|
363
+ | `1.0.4` (or similar) | Published — go to Step 1 |
364
+ | `404 Not Found` | **Not on registry.npmjs.org** (or wrong scope/name). `npm install` will not add the package → this error persists |
365
+
366
+ If you see **404**, DevOps has not published yet (or gateway CI lacks npm read access to `@swirepay`). Do not merge gateway code that imports the SDK until `npm view` returns a version.
367
+
368
+ **Step 1 — install and confirm**
369
+
370
+ ```bash
371
+ cd gateway-frontend
372
+ npm install @swirepay/sparo-embed-sdk
373
+ dir node_modules\@swirepay\sparo-embed-sdk\dist
374
+ ```
375
+
376
+ You must see `index.cjs` and `index.js` in that folder. If the folder is missing, the install did not succeed.
377
+
378
+ **Step 2**
379
+
380
+ 1. Restart `npm start` (CRA caches module resolution).
381
+ 2. In `package.json`, use a normal semver dependency — not a broken `file:` path to a machine-specific folder unless every dev shares that path.
382
+
383
+ ### Blank iframe / “Awaiting auth”
384
+
385
+ - Check `/sparo/token` returns valid JSON shape.
386
+ - Confirm `account` matches an allowlisted merchant.
387
+ - Confirm `sparoDomain` matches token mint environment (HTTPS in prod).
388
+
389
+ ### Mixed content blocked
390
+
391
+ - Page is `https://` but `sparoDomain` is `http://` → use HTTPS SPARO URL.
392
+
393
+ ### `merchant_not_enabled` (403)
394
+
395
+ - Merchant not on SPARO allowlist — contact SPARO admin, not a frontend bug.
396
+
397
+ ### `fetch_failed`
398
+
399
+ - Backend down, CORS issue, or user session expired.
400
+ - Check Network tab on `/sparo/token`.
401
+
402
+ ### Iframe works on refresh but not first load
403
+
404
+ - Ensure `mountRef.current` exists before calling `embed` (use `useEffect`, not render body).
405
+ - Do not call `embed` with `null` mount point.
406
+
407
+ ---
408
+
409
+ ## Minimal checklist
410
+
411
+ - [ ] `npm install @swirepay/sparo-embed-sdk`
412
+ - [ ] `REACT_APP_SPARO_DOMAIN` set per environment
413
+ - [ ] Backend `/sparo/token` implemented and tested
414
+ - [ ] `SparoChat` component with `useEffect` + `unmount` cleanup
415
+ - [ ] Route registered (e.g. `/sparo`)
416
+ - [ ] User has access to enabled merchant
417
+ - [ ] Dev server restarted after install
418
+
419
+ ---
420
+
421
+ ## Related docs
422
+
423
+ - [SPARO-EMBEDDING.md](./SPARO-EMBEDDING.md) — full architecture and backend mint examples
424
+ - [INSTALL.md](./INSTALL.md) — npm install troubleshooting
425
+ - [SECURITY.md](./SECURITY.md) — trust boundaries and secrets
426
+
427
+ ---
428
+
429
+ ## Support contacts
430
+
431
+ | Issue | Contact |
432
+ |-------|---------|
433
+ | SDK npm / import errors | Frontend platform / SDK maintainers |
434
+ | `/sparo/token` / `SPARO_ADMIN_KEY` | Backend team |
435
+ | Merchant allowlist | SPARO admin |
package/README.md CHANGED
@@ -1,23 +1,44 @@
1
1
  # SPARO Embed SDK
2
2
 
3
- `@swirepay/sparo-embed-sdk` embeds SPARO in any web application using:
3
+ `@swirepay/sparo-embed-sdk` embeds SPARO in web apps (including gateway React) using guest-token auth and an iframe.
4
4
 
5
- - iframe render (`/embed.html?embed=true&account=...`)
6
- - guest-token auth via `postMessage`
7
- - automatic token refresh before expiry
5
+ **Bitbucket:** https://bitbucket.org/zetametrics/sparo-swirepay-frontend.git
8
6
 
9
- For full backend + integration flow, see `SPARO-EMBEDDING.md`.
10
- For Maven/WebJar distribution, see `MAVEN-PUBLISH.md`.
7
+ ---
11
8
 
12
- ## Install
9
+ ## Who does what
10
+
11
+ | Role | Action |
12
+ |------|--------|
13
+ | **You (SDK)** | Push this repo to Bitbucket (`sdkmaster` or release branch). Bump version in `package.json` for each release. |
14
+ | **DevOps** | Clone repo → `npm ci` → `npm publish`. See **[DEVOPS-NPM-PUBLISH.md](./DEVOPS-NPM-PUBLISH.md)**. |
15
+ | **Gateway developer** | After publish: `npm install @swirepay/sparo-embed-sdk` and follow **[GATEWAY-REACT-GUIDE.md](./GATEWAY-REACT-GUIDE.md)**. |
16
+
17
+ Until DevOps publishes, gateway will show:
18
+
19
+ `Module not found: Can't resolve '@swirepay/sparo-embed-sdk'`
20
+
21
+ That is expected — the package is not on npm yet.
22
+
23
+ ---
24
+
25
+ ## Gateway install (after DevOps publish)
13
26
 
14
27
  ```bash
15
28
  npm install @swirepay/sparo-embed-sdk
16
29
  ```
17
30
 
18
- For private scope access, ensure the consumer app’s `.npmrc` is configured for your org registry (do not commit tokens).
31
+ ```json
32
+ {
33
+ "dependencies": {
34
+ "@swirepay/sparo-embed-sdk": "^1.0.4"
35
+ }
36
+ }
37
+ ```
38
+
39
+ Private package: use [.npmrc.example](./.npmrc.example) with org `NPM_TOKEN` (DevOps provides access).
19
40
 
20
- Local development without registry access: see [INSTALL.md](./INSTALL.md).
41
+ ---
21
42
 
22
43
  ## Quick Start
23
44
 
@@ -33,58 +54,30 @@ const handle = embed({
33
54
  if (!res.ok) throw new Error('token fetch failed');
34
55
  return await res.json(); // { token, expiresIn, account }
35
56
  },
36
- uiConfig: { theme: 'light' },
37
- onReady: () => console.log('SPARO ready'),
38
- onError: (err) => console.error('SPARO error', err),
39
57
  });
40
-
41
- // handle.unmount();
42
58
  ```
43
59
 
44
- ## API
45
-
46
- ### `embed(options)`
60
+ ---
47
61
 
48
- Required:
62
+ ## Docs
49
63
 
50
- - `sparoDomain: string`
51
- - `mountPoint: HTMLElement`
52
- - `fetchGuestToken: () => Promise<{ token: string, expiresIn: number, account: string }>`
64
+ | Document | Audience |
65
+ |----------|----------|
66
+ | [DEVOPS-NPM-PUBLISH.md](./DEVOPS-NPM-PUBLISH.md) | DevOps — publish to npm |
67
+ | [GATEWAY-REACT-GUIDE.md](./GATEWAY-REACT-GUIDE.md) | Gateway React — SparoChat integration |
68
+ | [SPARO-EMBEDDING.md](./SPARO-EMBEDDING.md) | Backend + architecture |
69
+ | [INSTALL.md](./INSTALL.md) | npm install / troubleshooting |
70
+ | [MAVEN-PUBLISH.md](./MAVEN-PUBLISH.md) | Java/WebJar only (not gateway) |
53
71
 
54
- Optional:
72
+ ---
55
73
 
56
- - `id: string` (default `sparo-embed`)
57
- - `uiConfig: object`
58
- - `onReady: () => void`
59
- - `onError: (error) => void`
60
-
61
- Returns:
62
-
63
- - `refresh(): Promise<void>`
64
- - `unmount(): void`
65
-
66
- ## Development
74
+ ## Development (SDK repo only)
67
75
 
68
76
  ```bash
69
77
  npm install
70
- npm run lint
71
- npm test
72
- npm run build
73
- npm pack --dry-run
78
+ npm run verify
74
79
  ```
75
80
 
76
- ## Package Outputs
77
-
78
- `npm run build` generates:
81
+ Build outputs: `dist/index.js`, `dist/index.mjs`, `dist/sparo-embed-sdk.global.js`
79
82
 
80
- - `dist/index.js` (CommonJS)
81
- - `dist/index.mjs` (ES module)
82
- - `dist/sparo-embed-sdk.global.js` (browser global: `window.SparoEmbedSDK`)
83
-
84
- ## Publish Checklist
85
-
86
- ```bash
87
- npm run verify
88
- npm pack --dry-run
89
- # npm publish --access restricted
90
- ```
83
+ `dist/` is built during `npm publish` via `prepublishOnly` — do not commit `dist/`.
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "@swirepay-developer/sparo-embed-sdk",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "SPARO embedding SDK for guest-token based iframe integration",
5
5
  "private": false,
6
6
  "license": "UNLICENSED",
7
7
  "author": "Swirepay",
8
8
  "sideEffects": false,
9
- "type": "module",
10
- "main": "./dist/index.cjs",
11
- "module": "./dist/index.js",
9
+ "main": "./dist/index.js",
10
+ "module": "./dist/index.mjs",
12
11
  "types": "./types/index.d.ts",
13
12
  "unpkg": "./dist/sparo-embed-sdk.global.js",
13
+ "type": "module",
14
14
  "jsdelivr": "./dist/sparo-embed-sdk.global.js",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./types/index.d.ts",
18
- "import": "./dist/index.js",
19
- "require": "./dist/index.cjs",
20
- "default": "./dist/index.js"
18
+ "import": "./dist/index.mjs",
19
+ "require": "./dist/index.js",
20
+ "default": "./dist/index.mjs"
21
21
  },
22
22
  "./package.json": "./package.json"
23
23
  },
@@ -27,6 +27,7 @@
27
27
  "README.md",
28
28
  "CHANGELOG.md",
29
29
  "SPARO-EMBEDDING.md",
30
+ "GATEWAY-REACT-GUIDE.md",
30
31
  "SECURITY.md",
31
32
  "LICENSE"
32
33
  ],
@@ -39,21 +40,28 @@
39
40
  ],
40
41
  "repository": {
41
42
  "type": "git",
42
- "url": "git+https://github.com/swirepay/sparo-embed-sdk.git"
43
+ "url": "git+https://bitbucket.org/zetametrics/sparo-swirepay-frontend.git"
43
44
  },
44
45
  "bugs": {
45
- "url": "https://github.com/swirepay/sparo-embed-sdk/issues"
46
+ "url": "https://bitbucket.org/zetametrics/sparo-swirepay-frontend/issues"
47
+ },
48
+ "homepage": "https://bitbucket.org/zetametrics/sparo-swirepay-frontend#readme",
49
+ "publishConfig": {
50
+ "access": "public",
51
+ "registry": "https://registry.npmjs.org/"
52
+ },
53
+ "engines": {
54
+ "node": ">=18"
46
55
  },
47
- "homepage": "https://github.com/swirepay/sparo-embed-sdk#readme",
48
56
  "scripts": {
49
57
  "clean": "rimraf dist",
50
58
  "build": "npm run clean && tsup src/sdk/index.js --format cjs,esm --out-dir dist --minify --clean && esbuild src/sdk/index.js --bundle --format=iife --global-name=SparoEmbedSDK --platform=browser --outfile=dist/sparo-embed-sdk.global.js --minify",
59
+ "build:sdk": "npm run build",
51
60
  "test": "vitest run",
52
61
  "test:watch": "vitest",
53
62
  "lint": "eslint src",
54
63
  "verify": "npm run lint && npm run test && npm run build",
55
- "prepublishOnly": "npm run verify",
56
- "prepare": "husky"
64
+ "prepublishOnly": "npm run verify"
57
65
  },
58
66
  "devDependencies": {
59
67
  "@testing-library/dom": "^10.4.0",