Skip to content

EventHandlerAPIPlugin (enterprise) docs#6370

Open
masenf wants to merge 1 commit intomainfrom
masenf/event-handler-api-plugin-docs
Open

EventHandlerAPIPlugin (enterprise) docs#6370
masenf wants to merge 1 commit intomainfrom
masenf/event-handler-api-plugin-docs

Conversation

@masenf
Copy link
Copy Markdown
Collaborator

@masenf masenf commented Apr 23, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 23, 2026

Greptile Summary

This PR adds documentation for the rxe.EventHandlerAPIPlugin enterprise feature, which exposes Reflex event handlers as HTTP POST endpoints with auto-generated OpenAPI 3 specs. It also registers the new page in the enterprise sidebar under "Configuration".

Confidence Score: 5/5

Safe to merge — all findings are P2 style/consistency suggestions that don't block correctness.

Both findings are P2: a port inconsistency in the LLM example prompts (3000 vs 8000 used elsewhere) and a missing EOF newline. Neither affects the accuracy of the core documentation or any code logic.

No files require special attention.

Important Files Changed

Filename Overview
docs/enterprise/event-handler-api.md New documentation page for EventHandlerAPIPlugin — comprehensive coverage of endpoints, auth, OpenAPI spec, and LLM-driven usage; minor port inconsistency (3000 vs 8000) in LLM prompt examples and missing EOF newline.
docs/app/reflex_docs/templates/docpage/sidebar/sidebar_items/enterprise.py Adds 'Event Handler API' sidebar entry under the Configuration section, consistent with existing sidebar item pattern.

Sequence Diagram

sequenceDiagram
    participant Client as API Client / LLM Agent
    participant Backend as Reflex Backend (8000)
    participant State as Reflex State

    Client->>Backend: GET /.well-known/api-catalog
    Backend-->>Client: RFC 9264 Linkset (points to openapi.yaml)

    Client->>Backend: GET /_reflex/events/openapi.yaml
    Backend-->>Client: OpenAPI 3 spec

    Client->>Backend: POST /_reflex/event/<state>/<handler> + Bearer token
    Backend->>State: Acquire state lock, run handler
    State-->>Backend: Yield state deltas
    Backend-->>Client: NDJSON stream of state deltas

    Client->>Backend: POST /_reflex/retrieve_state + Bearer token
    Backend->>State: Read full root state dict
    State-->>Backend: State dict
    Backend-->>Client: Full state JSON
Loading

Reviews (1): Last reviewed commit: "EventHandlerAPIPlugin (enterprise) docs" | Re-trigger Greptile

Comment on lines +361 to +379
> Use the API exposed at `http://localhost:3000/_reflex/events/openapi.yaml` to drive the application.
>
> Create a new ticket assigned to Masen for investigating RegistrationContext issues in reflex CI.

A well-equipped agent will:

1. `GET /_reflex/events/openapi.yaml` and parse the operations.
2. Generate a session token (`uuid4`) to use as the Bearer credential.
3. Call `POST /_reflex/event/.../create_ticket` with a body like
`{"title": "Investigate RegistrationContext issues in Reflex CI", "assignee": "Masen", "priority": "medium"}`.
4. Optionally call `/_reflex/retrieve_state` to confirm the ticket landed.

Other prompts that work well with the tickets demo:

> Using the Reflex API at `http://localhost:3000`, seed the database, then close every ticket currently assigned to `bob`.

> Via `http://localhost:3000/_reflex/events/openapi.yaml`, page through every ticket and summarize which assignees have the largest open backlog.

> Using the Reflex API at `http://localhost:3000`, create three high-priority tickets for the following issues, then show me the resulting state: <list of issues>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Port inconsistency in LLM example prompts

The curl examples throughout the document consistently use port 8000 (the backend), but the LLM prompt examples switch to port 3000 (the frontend/single-port port) without explanation. A reader who copies these prompts in a default dev setup (without single-port mode enabled) will get connection errors because 3000 only works in single-port mode. Either align all examples to port 8000, or add a short note explaining these prompts assume single-port mode is active.

- **Handlers that return `rx.redirect(...)` work over the API**, but the
redirect is emitted as a state delta rather than an HTTP 3xx — the client
sees the URL change, not a browser redirect. This is usually what you
want for programmatic clients. No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing newline at end of file

The file is missing a trailing newline. Most editors and linters expect files to end with a newline character.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 23, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing masenf/event-handler-api-plugin-docs (4c431ff) with main (2fe1a44)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant