gentiq 0.7.31 → 0.7.32

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 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