React
bash
npm install @datastripes/anomalytsx
import { DatastripesAnomaly } from '@datastripes/anomaly/react';
export function App() {
return (
<DatastripesAnomaly
data={myRows}
algorithm="ensemble"
apiKey={import.meta.env.VITE_DATASTRIPES_API_KEY}
apiUrl={import.meta.env.VITE_DATASTRIPES_API_URL}
/>
);
}@datastripes/anomaly/react re-exports everything from @datastripes/anomaly, so a single import covers components, the useAnomalyDetection hook, and all types.
react and react-dom (^19) are optional peer dependencies of @datastripes/anomaly, they are only required when you import the /react entry point, and your app almost certainly has them already.
To build your own UI on top of the engine instead of rendering DatastripesAnomaly, see Headless mode. For unordered (x, y) scatter data instead of a time series, see Scatter anomaly detection.