Getting Started
Datastripes ships as one npm package, @datastripes/forecast. The root entry is the framework-agnostic core; each UI framework gets its own subpath entry point inside the same package:
| Import path | Purpose |
|---|---|
@datastripes/forecast | Forecasting engine, auto-discovery, licensing client, types. No UI framework dependency. |
@datastripes/forecast/react | React components (DatastripesForecast and friends) + useWasmForecast hook. |
@datastripes/forecast/vue | Vue 3 components (DatastripesForecast and friends) + useWasmForecast composable. |
@datastripes/forecast/angular | Standalone Angular components (DatastripesForecastComponent and friends), built in Angular Package Format. |
@datastripes/forecast/elements | A <datastripes-forecast-studio> Custom Element (plus companion elements) for any stack. |
Every framework entry re-exports the core, so one import covers components, hooks, and types.
Install
bash
npm install @datastripes/forecastReact, Vue, and Angular are optional peer dependencies: installing the package never pulls in a UI framework. Install the one your app uses (most apps already have it):
bash
npm install react react-dom # for @datastripes/forecast/react
npm install vue # for @datastripes/forecast/vue
npm install @angular/core @angular/common # for @datastripes/forecast/angular
# @datastripes/forecast/elements needs no frameworkMinimal example (core only)
ts
import { executeForecast } from '@datastripes/forecast';
const result = await executeForecast({
data: [{ date: '2024-01-01', value: 120 }, /* ... */],
algorithm: 'prophet_lite',
horizon: 30
});
console.log(result.points, result.metrics, result.licenseStatus);See the framework-specific installation pages in this guide, and Licensing for how the trial/paid tiers work.