• Resolved signbuddy

    (@signbuddy)


    1. Headless React Integration I am building my custom chat UI in React. I see that AI Engine provides a REST API. Can my React frontend securely POST to this API to handle both conversational text (answering questions about neon signs) and image generation (generating logo concepts via DALL-E 3) within the same chat flow?

    2. Authentication & Rate Limiting via REST To prevent API billing abuse, I need to limit registered users to around 15 requests. I will be authenticating my React users via JWT (likely using CoCart). Will AI Engine Pro’s built-in usage tracking, analytics, and user limits automatically apply to requests made over the REST API when the user is authenticated via JWT?

    3. Discussion Memory Retention I know AI Engine handles discussion memory and history. Because this is a high-traffic setup, I want to keep my database lean by only retaining chat history for 7 days. Does the plugin have a built-in retention limit for chat logs, or will I need to write a custom WordPress cron job to clean up older chat entries?

    4. Intercepting Output for WooCommerce When a user generates a logo they like, I want them to be able to click a button in my React UI to add it to their cart as a custom neon sign product. Does the AI Engine REST API return the generated image URL in a predictable JSON response so my React frontend can easily extract it and pass it to the WooCommerce cart API as custom order metadata?

    Thank you for your time, looking forward to your insights!

Viewing 1 replies (of 1 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @signbuddy,

    This fits AI Engine well! 😊

    1. REST API (chat + images). Yes! For a headless frontend, use the chatbot endpoint POST /wp-json/mwai-ui/v1/chats/submit, which returns the reply and an images array in one JSON response. Full reference: https://ai.thehiddendocs.com/public-rest-api/ (and PHP/JS helpers at https://ai.thehiddendocs.com/php-functions/ if you’d rather proxy through your own route).
    2. Auth + rate limiting. The Limits feature keys off WordPress user identity, so what matters is that your JWT/CoCart layer reaches WP as an authenticated user. If it does, your ~15-per-user cap applies automatically; if not, it falls back to the guest bucket. Details: https://ai.thehiddendocs.com/limits/
    3. Chat history retention. Built in, no custom cron needed. There’s a retention setting that auto-deletes discussions older than N days. Set it to 7. See https://ai.thehiddendocs.com/chatbots/discussions/
    4. Image output JSON. Yes, predictable: the images array holds the generated URL(s), easy to extract and pass as cart metadata 😊

    One note for a public/headless setup: mind the nonce/session handling so the AI endpoints aren’t left open unauthenticated.

    Cheers,
    Jordy.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.