generated from vercel/ai-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Description
Add functionality to onboard users automatically when they visit the chat app with a cashu token provided in the query parameters, along with support for a prompt parameter to pre-populate the chat interface.
Requirements
- Parse cashu token from URL query parameters (e.g.,
?cashu=token_value) - Parse prompt from URL query parameters (e.g.,
?prompt=your_message_here) - Support combined parameters (e.g.,
?cashu=token_value&prompt=your_message_here) - Validate the cashu token format and authenticity
- Automatically create/setup user account using the cashu token
- Handle token redemption process
- Pre-populate chat interface with the provided prompt message
- Provide user feedback during onboarding process
- Handle error cases (invalid token, expired token, etc.)
- Redirect user to appropriate chat interface after successful onboarding
Acceptance Criteria
- Users can visit chat.routstr.com with
?cashu=<token>and be automatically onboarded - Users can visit chat.routstr.com with
?prompt=<message>to pre-populate the chat - Users can visit chat.routstr.com with
?cashu=<token>&prompt=<message>for combined functionality - Invalid or expired tokens show appropriate error messages
- Successful onboarding redirects to the main chat interface with prompt pre-populated (if provided)
- Token is consumed/redeemed during the onboarding process
- Prompt parameter is URL-decoded and properly displayed in the chat interface
Technical Notes
- Consider security implications of token handling
- Ensure proper error handling and user experience
- May need integration with cashu wallet/mint functionality
- Implement proper URL encoding/decoding for prompt parameter
- Handle special characters and long prompts appropriately
Metadata
Metadata
Assignees
Labels
No labels