Skip to main content
It includes @photon-rx/core, the JavaScript client, so you don’t install that separately. ⚠️ Not published to npm yet.
The cards have no page chrome: no header, no fixed bars, no viewport breakpoints. They size to their container, so they fit a page, a dialog or a side panel.

Try it

<PhotonOrder /> in /integrate, with the events it fires, the live objects behind it and the requests they make.

PhotonProvider

Wrap the cards in one provider. It signs the prescriber in and gives every card inside it a client. Providers can nest. A nested provider inherits what it doesn’t set, and providers with the same clientId share one sign-in.

Signing in

On load, the provider signs in by itself when it can: it finishes a sign-in returning from Photon, or renews a stored session. It never redirects on its own. Otherwise, the first card on the page shows Sign in to Photon, and the prescriber clicks it. Inside an iframe, sign-in opens a popup. The cards don’t offer sign-out. Your app can sign out with usePhoton().session.signOut(). useSession() gives your own chrome the prescriber’s name, email and organization.
The access token stays in memory, but your page’s localStorage keeps the refresh token, so any script on your page can read it. Treat script injection there as a token leak, and set a Content-Security-Policy. Auth0 rotates the refresh token on every use and revokes it as soon as an old one is reused, which cuts off a stolen one. To manage tokens yourself, sign in with your own Auth0 setup and pass a client with auth: { getToken }.

PhotonOrder

The patient, a card for each prescription, then the send button: Send prescription to patient (Send prescriptions to patient for several, or Send to the pharmacy when the order already has one). It appears once the patient is found, every prescription is signed, and everything is saved. Without prescriptions, the order starts with one empty line. Add another prescription starts from the same template as the first line.

PhotonPatient

Find or add a patient, then edit them. Each field the prescriber fills in is synced, and Photon decides whether that’s a match, a list of candidates, or a new patient. Try it.

PhotonPrescription

One prescription: the drug, sig and dispense, screening, and Sign. A signed prescription is final. Try it.

Events

Every event gets the live object. obj.id is the record’s id, and obj.state is the record itself, with the same fields as the API. Events fire when Photon has a record and when that record changes. They don’t fire while a save is in flight.

Live objects as props

Any record prop also takes a live object from the JavaScript client. The card uses it as is and doesn’t fetch it again, and anything else holding the same object sees every change.
Last modified on October 12, 2026