Getting Started
Installation
Install the Streamflow JS SDK packages
Install @streamflow/stream using your preferred package manager.
npm install @streamflow/streampnpm add @streamflow/streamyarn add @streamflow/streambun add @streamflow/streamBrowser Polyfills
The SDK uses Node.js built-in modules (e.g., node:crypto). For browser runtimes, you may need polyfills:
- Vite - vite-plugin-node-polyfills
- Webpack - node-polyfill-webpack-plugin
- Rsbuild - rsbuild-plugin-node-polyfill
Transitive dependencies may import bare module names (e.g. crypto) or node:-prefixed names (e.g. node:crypto) - ensure the polyfill covers both forms.
TypeScript configuration
The SDK uses NodeNext module resolution internally. If you're using TypeScript, your tsconfig.json must use "moduleResolution": "NodeNext" (or "bundler" for Vite/Webpack projects) - "node" will fail to resolve subpath exports like @streamflow/stream/solana/api.
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext"
}
}For bundler-based projects (Vite, Webpack, Rsbuild):
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "bundler"
}
}