gentiq 0.7.31 → 0.8.0
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 +45 -0
- package/dist/{checkbox-CXJMAW8-.js → checkbox-CjhpdOWd.js} +717 -699
- package/dist/gentiq-admin.es.js +1447 -1145
- package/dist/gentiq-index.es.js +827 -817
- package/dist/gentiq.css +1 -1
- package/dist/src/admin/lib/api.d.ts +30 -3
- package/dist/src/admin/lib/format.d.ts +2 -0
- package/dist/src/hooks/useGentiqAdmin.d.ts +4 -1
- package/dist/src/hooks/useGentiqUser.d.ts +184 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/api.d.ts +3 -3
- package/dist/src/locales/en.json.d.ts +32 -0
- package/dist/src/locales/fa.json.d.ts +32 -0
- package/dist/src/types.d.ts +35 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -214,6 +214,51 @@ Easily extend user profiles and signup forms with your own fields. Gentiq handle
|
|
|
214
214
|
</GentiqProvider>
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
+
## Personalized Greetings
|
|
218
|
+
|
|
219
|
+
Use a functional greeting to personalize the built-in welcome screen. Gentiq
|
|
220
|
+
loads and caches the authenticated profile for you:
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<GentiqProvider
|
|
224
|
+
welcome={{
|
|
225
|
+
greeting: ({ firstName, t }) =>
|
|
226
|
+
t(firstName ? 'chat:welcome.named' : 'chat:welcome.default', {
|
|
227
|
+
firstName,
|
|
228
|
+
}),
|
|
229
|
+
}}
|
|
230
|
+
i18n={{
|
|
231
|
+
resources: {
|
|
232
|
+
en: {
|
|
233
|
+
chat: {
|
|
234
|
+
welcome: {
|
|
235
|
+
default: 'How can I help you today?',
|
|
236
|
+
named: 'Hi {{firstName}}, how can I help you today?',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
<ChatUI />
|
|
244
|
+
</GentiqProvider>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
For custom screens or other components, use the same profile data directly:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
import { useGentiqUser } from 'gentiq';
|
|
251
|
+
|
|
252
|
+
function MyWelcomeScreen() {
|
|
253
|
+
const { user, firstName, isLoading, error } = useGentiqUser();
|
|
254
|
+
|
|
255
|
+
if (isLoading) return null;
|
|
256
|
+
if (error) return <h1>Welcome!</h1>;
|
|
257
|
+
|
|
258
|
+
return <h1>Welcome, {firstName || user?.phone}!</h1>;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
217
262
|
---
|
|
218
263
|
|
|
219
264
|
## 📄 License
|