@masterunoco/casinowebengine-api 0.1.0 → 0.1.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 +17 -93
  2. package/package.json +9 -3
package/README.md CHANGED
@@ -1,6 +1,9 @@
1
- # đŸ•šī¸ Gaming Platform – GameService SDK
1
+ # đŸ•šī¸ Casino Web Engine API SDK
2
2
 
3
- A **TypeScript front-end SDK** for interacting with the `gameService` and related APIs across casino front-end projects.
3
+ [![npm version](https://img.shields.io/npm/v/@masterunoco/casinowebengine-api.svg)](https://www.npmjs.com/package/@masterunoco/casinowebengine-api)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@masterunoco/casinowebengine-api.svg)](https://www.npmjs.com/package/@masterunoco/casinowebengine-api)
5
+
6
+ A **TypeScript front-end SDK** for interacting with the casino web-engine API across casino front-end projects.
4
7
  It provides a unified interface for games, authentication, content, player preferences, website settings, and more — all with full type safety and automatic JWT handling.
5
8
 
6
9
  ---
@@ -10,7 +13,7 @@ It provides a unified interface for games, authentication, content, player prefe
10
13
  - 🤩 **Typed API layer** – all endpoints return strongly-typed responses.
11
14
  - 🔐 **Built-in JWT auth** – automatically attaches `Authorization: JWT <token>` to protected requests.
12
15
  - 🌐 **Public + private endpoints** – transparent auth handling (`none`, `optional`, `required`).
13
- - âš™ī¸ **Configurable** – base URL, brand, currency, language, and timeout.
16
+ - âš™ī¸ **Configurable** – base URL and timeout.
14
17
  - 🗾 **Persistent storage** – stores tokens and user data via localStorage helper.
15
18
  - 🧠 **Framework-agnostic** – works with any front-end (React, Vue, Next.js, etc.).
16
19
  - đŸĨˇ **Ready for npm** – ships with ESM + CJS + `.d.ts` types.
@@ -19,9 +22,8 @@ It provides a unified interface for games, authentication, content, player prefe
19
22
 
20
23
  ## đŸ“Ļ Installation
21
24
 
22
- ### From npm (when published)
23
25
  ```bash
24
- npm install @cwe/frontend-sdk
26
+ npm install @masterunoco/casinowebengine-api
25
27
  ```
26
28
 
27
29
  ### Local development
@@ -31,17 +33,9 @@ If the SDK is cloned locally:
31
33
  npm run build
32
34
 
33
35
  # In your front-end project
34
- npm install ../path-to/gameservice-sdk
36
+ npm install ../path-to/casinowebengine-api
35
37
  # or
36
- npm i file:../gameservice-sdk
37
- ```
38
-
39
- ### Workspace monorepo
40
- If both live in the same repo:
41
- ```json
42
- "dependencies": {
43
- "@cwe/frontend-sdk": "workspace:*"
44
- }
38
+ npm i file:../path-to/casinowebengine-api
45
39
  ```
46
40
 
47
41
  ---
@@ -49,15 +43,11 @@ If both live in the same repo:
49
43
  ## 🧰 Basic Setup
50
44
 
51
45
  ```ts
52
- import { createGameSDK } from '@cwe/frontend-sdk';
46
+ import { createGameSDK } from '@masterunoco/casinowebengine-api';
53
47
 
54
48
  const sdk = createGameSDK({
55
49
  baseUrl: import.meta.env.VITE_GAMESERVICE_URL,
56
- brand: 'BrandA',
57
- defaultLanguage: 'en',
58
- defaultCurrency: 'USD',
59
- storage: localStorage,
60
- storageKey: 'gp.jwt',
50
+ timeoutMs: 15000,
61
51
  });
62
52
  ```
63
53
 
@@ -130,83 +120,18 @@ src/
130
120
  ├─ http/client.ts # Fetch wrapper with timeout & authPolicy
131
121
  ├─ auth/jwtAuth.ts # JWT lifecycle (login, store, clear)
132
122
  ├─ apis/
133
- │ ├─ games.ts # /games, /games/search
134
- │ ├─ settings.ts # /content-pages, /website-settings, /player/preferences
135
- │ ├─ geo.ts # /geo/location
136
- │ └─ ... (other feature modules)
123
+ │ ├─ games.ts
124
+ │ ├─ settings.ts
125
+ │ ├─ geo.ts
126
+ │ └─ ...
137
127
  ├─ types/
138
128
  │ ├─ auth.ts
139
129
  │ ├─ gamesSearch.ts
140
130
  │ ├─ settings.ts
141
131
  │ └─ signup.ts
142
- └─ localStorage.ts # Persistent storage helper
132
+ └─ localStorage.ts
143
133
  ```
144
134
 
145
- Each API module uses the shared `HttpClient` and defines its own types and interfaces.
146
-
147
- ---
148
-
149
- ## 🗾 Configuration Options
150
-
151
- | Option | Type | Description |
152
- |--------|------|-------------|
153
- | `baseUrl` | `string` | Base API URL for gameService |
154
- | `brand` | `string` | Optional brand name for `X-Brand` header |
155
- | `defaultLanguage` | `string` | Default language header |
156
- | `defaultCurrency` | `string` | Default currency header |
157
- | `storage` | `Storage` | Browser storage (e.g., `localStorage`) |
158
- | `storageKey` | `string` | Key under which JWT is stored |
159
- | `timeoutMs` | `number` | Request timeout in milliseconds |
160
-
161
- ---
162
-
163
- ## đŸĨĒ Development
164
-
165
- ```bash
166
- # Build for production
167
- npm run build
168
-
169
- # Watch mode
170
- npm run dev
171
-
172
- # Type-check only
173
- npm run typecheck
174
-
175
- # Lint
176
- npm run lint
177
- ```
178
-
179
- ---
180
-
181
- ## đŸĨą Local Testing with Front-end
182
-
183
- In your front-end project:
184
-
185
- ```ts
186
- import { createGameSDK } from '@cwe/frontend-sdk';
187
-
188
- const sdk = createGameSDK({
189
- baseUrl: 'https://api.yourdomain.com/game-service',
190
- storage: localStorage,
191
- storageKey: 'gp.jwt',
192
- });
193
-
194
- const games = await sdk.games.searchGames({ category: 'slots' });
195
- console.log(games.results.length);
196
- ```
197
-
198
- ---
199
-
200
- ## 🤩 Building Blocks (Available APIs)
201
-
202
- | Module | Description |
203
- |---------|-------------|
204
- | `auth` | Handles login, token management, user retrieval |
205
- | `games` | Search, list, and launch games |
206
- | `settings` | Content pages, banners, preferences, currencies, and website settings |
207
- | `geolocation` | Detect and cache player location |
208
- | `localStorage` | Utility for token, user, and geo persistence |
209
-
210
135
  ---
211
136
 
212
137
  ## 🗾 Build Output
@@ -222,6 +147,5 @@ dist/
222
147
 
223
148
  ## 🗾 License
224
149
 
225
- MIT Š 2025 Gaming Platform
226
- Developed by **Eyal (Venus Technology / Gaming Platform)**
150
+ MIT Š 2025
227
151
 
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@masterunoco/casinowebengine-api",
3
- "version": "0.1.0",
4
- "description": "Typed front-end SDK for casino webengine API",
3
+ "version": "0.1.2",
4
+ "description": "Typed front-end SDK for casino web-engine API",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
9
12
  "exports": {
10
13
  ".": {
11
14
  "import": "./dist/index.js",
@@ -13,7 +16,10 @@
13
16
  "types": "./dist/index.d.ts"
14
17
  }
15
18
  },
16
- "files": ["dist", "README.md"],
19
+ "files": [
20
+ "dist",
21
+ "README.md"
22
+ ],
17
23
  "sideEffects": false,
18
24
  "dependencies": {
19
25
  "@mui/material": "^7.3.5",