| title | Integrate with Faust.js |
|---|---|
| description | Learn how to integrate the HWP Previews plugin with Faust.js in your headless WordPress application. |
This guide shows you how to use HWP Previews with Faust.js. The integration happens automatically when both plugins are installed.
- Faust.js plugin installed and activated
- Install and activate the HWP Previews plugin
- Navigate to Settings > HWP Previews
HWP Previews automatically detects Faust.js and configures itself to work with Faust's preview system.
When HWP Previews detects Faust.js, it:
- Enables previews for all public post types
- Sets the preview URL template to match Faust's expected format:
{FAUST_FRONTEND_URI}/preview?p={ID}&preview=true&previewPathname=p{ID}&typeName={type} - Removes Faust.js's native preview link filter to prevent conflicts
- Disables Faust's redirect functionality for preview URLs
- Shows an admin notice on the settings page confirming the integration
The {FAUST_FRONTEND_URI} is automatically pulled from your Faust.js settings. If not configured, it defaults to http://localhost:3000.
HWP Previews handles preview URL generation, but authentication remains the responsibility of your Faust front-end application. Continue using Faust.js authentication to access draft content in previews.
- Go to Settings > HWP Previews
- Check any post type tab (Posts, Pages, etc.)
- Verify that:
- "Enable HWP Previews" is checked
- The Preview URL Template contains your Faust front-end URL
- Open any post in the WordPress editor
- Click the "Preview" button
- You should be redirected to your Faust front-end preview endpoint
The preview URL will look like:
https://your-faust-site.com/preview?p=42&preview=true&previewPathname=p42&typeName=post
