PhoenixKitBookings.Web.Public.BookingWidgetLive (PhoenixKitBookings v0.1.1)

Copy Markdown View Source

The embeddable booking widget — the same BookingFlow as the routed page, mountable on ANY host page via live_render/3:

<%= live_render(@conn, PhoenixKitBookings.Web.Public.BookingWidgetLive,
      id: "book-massage",
      session: %{
        "slug" => "massage-60",
        "current_user_uuid" => @current_user_uuid,   # optional
        "prefill" => %{"customer_email" => @email},  # optional
        "wrapper_class" => "my-custom-frame"         # optional
      }) %>

Deliberately exports no handle_params/3 — Phoenix refuses to mount a LiveView that exports it outside a router live route, which would break embedding (the phoenix_kit_projects embedding lesson). Because live_render skips router on_mount hooks, the host passes the current user's uuid through the session if logged-in behavior is wanted (login_required services, prefill).