AllStak React SDK for error boundaries, global browser errors, logs, HTTP telemetry, Web Vitals, spans, replay metadata, and source maps.
npm install @allstak/reactimport { AllStakProvider } from '@allstak/react';
export function App() {
return (
<AllStakProvider
apiKey={import.meta.env.VITE_ALLSTAK_API_KEY}
environment={import.meta.env.MODE}
release={import.meta.env.VITE_ALLSTAK_RELEASE}
service="web"
>
<AppRoot />
</AllStakProvider>
);
}import { AllStak, useAllStak } from '@allstak/react';
AllStak.captureMessage('cart opened', 'info');
AllStak.captureException(new Error('checkout failed'));
AllStak.setUser({ id: 'user_123', email: 'user@example.com' });
function CheckoutButton() {
const { captureException } = useAllStak();
return <button onClick={() => captureException(new Error('failed'))}>Pay</button>;
}import { createRoot } from 'react-dom/client';
import * as AllStak from '@allstak/react';
createRoot(document.getElementById('root')!, {
onUncaughtError: AllStak.reactErrorHandler(),
onCaughtError: AllStak.reactErrorHandler(),
onRecoverableError: AllStak.reactErrorHandler(),
}).render(<App />);import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { allstakVitePlugin } from '@allstak/react/vite';
export default defineConfig({
build: { sourcemap: true },
plugins: [
react(),
allstakVitePlugin({
release: process.env.ALLSTAK_RELEASE,
uploadToken: process.env.ALLSTAK_UPLOAD_TOKEN,
}),
],
});The SDK redacts common sensitive headers, query params, and body fields. Use beforeSend and HTTP redaction options for app-specific rules.
- No events: confirm the API key is exposed to the browser build and not empty.
- Source maps missing: use the same
releasein the SDK and upload plugin. - Browser requests blocked: allow
https://api.allstak.sain your content security policy.
- Report bugs with the GitHub bug report template: https://github.com/AllStak/allstak-react/issues/new/choose
- Open pull requests using the checklist in CONTRIBUTING.md.
- Report security vulnerabilities privately through SECURITY.md.
MIT
