@gentour/dedge-support-widget 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.
- package/README.md +90 -7
- package/dist/config.d.ts +14 -2
- package/dist/widget.esm.js +1 -1
- package/dist/widget.esm.js.map +1 -1
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -67,21 +67,58 @@ Ce contexte est envoyé au backend pour le tracking/analytics dans Langfuse.
|
|
|
67
67
|
|
|
68
68
|
## Development
|
|
69
69
|
|
|
70
|
-
###
|
|
70
|
+
### Setup
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
73
|
# Install dependencies
|
|
74
74
|
npm install
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Build pour DEV (local)
|
|
78
|
+
|
|
79
|
+
Le fichier `.env` contient les URLs locales :
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
```bash
|
|
82
|
+
# .env (pour développement local)
|
|
83
|
+
SUPABASE_URL=https://gkhinqkwwvxfuhiizbzq.supabase.co
|
|
84
|
+
SUPABASE_ANON_KEY=sb_publishable_xxx
|
|
85
|
+
DEFAULT_FRONTEND_URL=http://localhost:3007
|
|
86
|
+
DEFAULT_API_URL=http://localhost:2025
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Build :
|
|
90
|
+
|
|
91
|
+
```bash
|
|
79
92
|
npm run build
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Build pour PROD (avant publish NPM)
|
|
96
|
+
|
|
97
|
+
Le fichier `.env.production` contient les URLs de production :
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# .env.production (pour production)
|
|
101
|
+
SUPABASE_URL=https://gkhinqkwwvxfuhiizbzq.supabase.co
|
|
102
|
+
SUPABASE_ANON_KEY=sb_publishable_xxx
|
|
103
|
+
DEFAULT_FRONTEND_URL=https://dedgesupport.gentour.ai
|
|
104
|
+
DEFAULT_API_URL=https://dedgesupport.gentour.ai/api
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Build :
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm run build:prod
|
|
111
|
+
```
|
|
80
112
|
|
|
81
|
-
|
|
113
|
+
### Watch mode (dev)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
82
116
|
npm run dev
|
|
117
|
+
```
|
|
83
118
|
|
|
84
|
-
|
|
119
|
+
### Serve locally
|
|
120
|
+
|
|
121
|
+
```bash
|
|
85
122
|
npm run serve # Serves on http://localhost:3001
|
|
86
123
|
```
|
|
87
124
|
|
|
@@ -96,12 +133,58 @@ document.head.appendChild(script);
|
|
|
96
133
|
|
|
97
134
|
script.onload = () => {
|
|
98
135
|
DEdgeSupportWidget.init({
|
|
99
|
-
frontendUrl: 'http://localhost:
|
|
136
|
+
frontendUrl: 'http://localhost:3007',
|
|
100
137
|
credentials: btoa('widget@dedge.gentour.ai:yourPassword'),
|
|
101
138
|
});
|
|
102
139
|
};
|
|
103
140
|
```
|
|
104
141
|
|
|
142
|
+
## Publish to NPM
|
|
143
|
+
|
|
144
|
+
### Prerequisites
|
|
145
|
+
|
|
146
|
+
1. Vous devez être connecté à NPM :
|
|
147
|
+
```bash
|
|
148
|
+
npm login
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
2. Vérifiez que vous avez les droits sur le package `@gentour/dedge-support-widget`
|
|
152
|
+
|
|
153
|
+
### Publish workflow
|
|
154
|
+
|
|
155
|
+
1. **Update version** dans `package.json` :
|
|
156
|
+
```bash
|
|
157
|
+
npm version patch # 0.1.1 -> 0.1.2
|
|
158
|
+
# ou
|
|
159
|
+
npm version minor # 0.1.1 -> 0.2.0
|
|
160
|
+
# ou
|
|
161
|
+
npm version major # 0.1.1 -> 1.0.0
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
2. **Build avec config production** :
|
|
165
|
+
```bash
|
|
166
|
+
npm run build:prod
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Note : Le hook `prepublishOnly` fait automatiquement `npm run build:prod` avant publication.
|
|
170
|
+
|
|
171
|
+
3. **Publish** :
|
|
172
|
+
```bash
|
|
173
|
+
npm publish --access public
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
4. **Tag et push** :
|
|
177
|
+
```bash
|
|
178
|
+
git push && git push --tags
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Quick publish
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# All in one
|
|
185
|
+
npm version patch && npm publish --access public && git push --tags
|
|
186
|
+
```
|
|
187
|
+
|
|
105
188
|
## API
|
|
106
189
|
|
|
107
190
|
### Instance Methods
|
package/dist/config.d.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* Build-time configuration for the widget
|
|
3
3
|
* These values are injected at build time from environment variables
|
|
4
4
|
*
|
|
5
|
-
* Usage: Set
|
|
6
|
-
* Example:
|
|
5
|
+
* Usage: Set environment variables before building
|
|
6
|
+
* Example:
|
|
7
|
+
* SUPABASE_URL=https://xxx.supabase.co \
|
|
8
|
+
* SUPABASE_ANON_KEY=eyJ... \
|
|
9
|
+
* DEFAULT_FRONTEND_URL=http://localhost:3007 \
|
|
10
|
+
* DEFAULT_API_URL=http://localhost:2025 \
|
|
11
|
+
* npm run build
|
|
7
12
|
*/
|
|
8
13
|
/**
|
|
9
14
|
* Get Supabase configuration if available
|
|
@@ -13,3 +18,10 @@ export declare function getSupabaseConfig(): {
|
|
|
13
18
|
url: string;
|
|
14
19
|
anonKey: string;
|
|
15
20
|
} | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get default URLs for the widget
|
|
23
|
+
*/
|
|
24
|
+
export declare function getDefaultUrls(): {
|
|
25
|
+
frontendUrl: string;
|
|
26
|
+
apiUrl: string;
|
|
27
|
+
};
|