Error tracking for Laravel websites and web apps. Errors go to NativeWatch.
composer require zinxan/native-webAdd the Server client key of your NativeWatch project to .env (never embed a Server key in public HTML):
NATIVEWATCH_KEY=nw_...
NATIVEWATCH_URL=https://native.watchSend a test error:
php artisan nativewatch:testTo capture browser JavaScript errors and unhandled promise rejections from your Laravel pages, add @nativewatchScripts to your root Blade layout's <head> before your frontend scripts. On web projects, /_nativewatch/browser-errors requires positive same-origin Origin/Referer headers by default, strips query strings and fragments from page and frame URLs, and reports errors with the browser and browser.unhandledrejection mechanisms. You can add 'web' middleware (session/CSRF) to nativewatch.browser.middleware in config/nativewatch.php if desired.
Because websites serve multiple visitors from one server, zinxan/native-web deliberately disables native-core's single-device on-disk FileConsent store so one visitor cannot change consent or clear the outbox for others. Gate per-visitor consent with NativeWatch::beforeSend() or conditionally render @nativewatchScripts from your app's own cookie/session consent state.
Request scope, deduplication cache, and per-request beforeSend callbacks reset automatically between requests (including Laravel Octane workers), while boot-time beforeSend hooks registered in service providers are preserved.
For static or non-Laravel websites, use NativeWatch's hosted browser script (https://native.watch/sdk/browser.js) with a dedicated Browser client key and your site's allowed origins configured in NativeWatch.