Reactive JavaScript

Prisma PHP uses PulsePoint as its native reactive engine. There is no complex bundling or setup required. Every <script> tag in your view is automatically treated as a reactive component.

Read Official PulsePoint Docs
Integrated & Configured automatically

Prisma PHP

The Environment. It handles routing, server-side rendering, and security. It injects the directives that allow PulsePoint to communicate with the server securely.

PulsePoint

The Reactive Engine. While it is a standalone library (see link above), Prisma PHP integrates it deeply, hydrating the DOM and exposing global utilities automatically.

Zero-API Interaction

The most powerful feature of this stack is pp.fetchFunction. You do not need to build REST APIs to handle button clicks or form submissions. You simply listen to an event in JavaScript and request a PHP function execution. The environment handles the security and routing automatically.

Core Capabilities

Beyond fetching data, the pp-utilities.ts library provides singletons to manage application state, navigation, and URL parameters without refreshing the page.

Smart Redirection
pp.redirect(url)

Intelligently detects the target URL. If it's internal, it performs a smooth SPA transition using navigateTo. If it's external, it performs a standard window redirection.

Synced Local Store
store.setState(data, true)

Manages reactive local storage. The optional second parameter syncWithBackend automatically sends the state to your PHP backend via fetchFunction for persistence.

URL Listeners
searchParams.listen(cb)

Allows you to trigger logic when URL parameters change (e.g., via Back button or history.pushState), enabling deep-linking support for modals and tabs.

API Reference

Global Object Method / Property Description
pp fetchFunction(name, data, abort?) Securely executes a PHP function. Supports automatic JWT encryption and file uploads.
navigateTo(url, pushState?) Triggers a smooth SPA transition to a new URL without a full page reload.
redirect(url) Hybrid redirector for both internal SPA routes and external links.
store state Direct access to the storage object. Usage: store.state.myKey.
setState(update, sync?) Updates local reactive state. If sync is true, posts data to the server.
resetState(id?, sync?) Clears specific keys or the entire local storage state for the application.
searchParams set(key, value) Updates URL query string and pushes history without reloading.
get(key) Reactive retrieval of current URL query parameters.
listen(callback) Registers a listener to trigger logic when parameters change.