Client SDKs
Overview of Stepflow client SDKs for TypeScript, React, and React Native
Client SDKs
Stepflow provides a set of client SDKs to interact with your workflows from the frontend or other services. All SDKs are built with TypeScript and provide full type safety.
Available Packages
| Package | Description | Platform |
|---|---|---|
@stepflowjs/client | Core TypeScript client | Node.js, Browser, Edge |
@stepflowjs/react | React hooks and providers | React, Next.js, Remix |
@stepflowjs/react-native | React Native hooks | iOS, Android (Expo) |
Key Features
- Type Safety: Full TypeScript support with inference for event payloads and results.
- Real-time Updates: Built-in support for SSE (Server-Sent Events) and WebSockets with automatic fallback.
- Token Management: Securely handle public access tokens with automatic storage and refresh.
- Framework Integration: First-class hooks for React and React Native.
Installation
Choose the package that fits your project:
# TypeScript client
pnpm add @stepflowjs/client
# React hooks
pnpm add @stepflowjs/react @stepflowjs/client
# React Native hooks
pnpm add @stepflowjs/react-native @stepflowjs/clientAuthentication
Stepflow clients support three types of authentication:
- API Key (
apiKey): Used for server-to-server communication. Grants full access. - Public API Key (
publicApiKey): Used in frontend applications to trigger workflows. - Public Access Token (
accessToken): Short-lived tokens granted to specific workflow runs, allowing clients to track progress without exposing a global key.