
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@remoteoss/remote-flows
Advanced tools
[](https://www.npmjs.com/package/@remoteoss/remote-flows) [ {
const fetchToken = async () => {
const response = await fetch('/api/auth/token');
return response.json();
};
return (
<RemoteFlows
components={defaultComponents}
auth={fetchToken}
environment='partners'
>
<CostCalculator onSuccess={(data) => console.log(data)} />
</RemoteFlows>
);
}
The RemoteFlows component serves as a provider for authentication and theming.
| Prop | Type | Required | Deprecated | Description |
|---|---|---|---|---|
auth | () => Promise<{ accessToken: string, expiresIn: number }> | No | - | Function to fetch authentication token. Optional when using cookie-based authentication via credentials prop |
environment | 'partners' | 'production' | 'sandbox' | 'staging' | No | - | Environment to use for API calls (defaults to production) |
theme | ThemeOptions | No | - | Custom theme configuration |
components | Components | No | - | Custom field components for form rendering |
proxy | { url: string, headers?: Record<string, string> } | No | - | Configuration for API request proxy with optional headers |
errorBoundary | { useParentErrorBoundary?: boolean, fallback?: ReactNode | ((error: Error) => ReactNode) } | No | - | Error boundary configuration to prevent crashes and show custom fallback UI |
debug | boolean | No | - | useful to see telemetry debugging in console |
credentials | 'include' | 'same-origin' | No | - | Credentials mode for fetch requests. Use 'include' for cookie-based authentication without bearer tokens |
The errorBoundary prop controls how the SDK handles runtime errors to prevent crashes in your host application.
<RemoteFlows
components={defaultComponents}
auth={fetchToken}
errorBoundary={{
useParentErrorBoundary: false,
fallback: (error) => (
<div style={{ padding: '20px', textAlign: 'center' }}>
<h2>Something Went Wrong</h2>
<p>{error.message}</p>
<button onClick={() => window.location.reload()}>Reload Page</button>
</div>
),
}}
>
{/* Your flows */}
</RemoteFlows>
Options:
useParentErrorBoundary (boolean, default: false): If true, errors are re-thrown to your parent error boundary. If false, the SDK shows a fallback UI to prevent crashes.fallback (ReactNode | function, optional): Custom UI to display when an error occurs. Only used when useParentErrorBoundary is false. Can be a React element or a function that receives the error object.Behavior:
useParentErrorBoundary: true → Errors propagate to your application's error boundaryuseParentErrorBoundary: false without fallback → Shows default error message: "Something went wrong in RemoteFlows. Please refresh the page."useParentErrorBoundary: false with fallback → Shows your custom fallback UIYou can customize form field components to match your application's design system.
For detailed documentation on component customization including step-level and field-specific overrides, see the Component Customization Guide.
Each flow handles a specific Remote employment operation. For detailed API documentation, see the individual flow READMEs:
You need to implement a server endpoint to securely handle authentication with Remote. This prevents exposing client credentials in your frontend code.
Your server should:
access_token and expires_in to the frontend applicationFor a complete implementation, check our example server implementation.
https://gateway.partners.remote-sandbox.comhttps://gateway.remote.com/Import the CSS file in your application:
@import '@remoteoss/remote-flows/styles.css';
<RemoteFlows
theme={{
spacing: '0.25rem',
borderRadius: '0px',
colors: {
primaryBackground: '#ffffff',
primaryForeground: '#364452',
accentBackground: '#e3e9ef',
accentForeground: '#0f1419',
danger: '#d92020',
borderInput: '#cccccc',
},
}}
>
{/* Your components */}
</RemoteFlows>
| Token | Description |
|---|---|
colors.borderInput | Border color for input fields. |
colors.primaryBackground | Background used for the popover options |
colors.primaryForeground | Color text for the input and options |
colors.accentBackground | Used in the option selected and hover. |
colors.accentForeground | Color text for the select options |
colors.danger | Red color used for danger states. |
spacing | Consistent scale for whitespace (margin, padding, gap). |
borderRadius | The main border radius value (default: 0.625rem). This is the foundation for all other radius values. |
font.fontSizeBase | The main font size value (default: 1rem). Controls the base text size of the component. |
All components expose CSS classes prefixed with RemoteFlows__ for targeted styling:
Example: Customize the Cost Calculator layout:
.RemoteFlows__CostCalculatorForm {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
}
.RemoteFlows__SelectField__Item__country {
grid-column: span 2;
}
.RemoteFlows__CostCalculatorForm .RemoteFlows__Button {
grid-column: span 2;
}
For complete control over rendering, use our hooks directly. They handle the business logic while you control the UI:
import { useCostCalculator } from '@remoteoss/remote-flows';
function CustomCostCalculator() {
const {
onSubmit: submitCostCalculator,
fields, // Field definitions from json-schema-form
validationSchema,
} = useCostCalculator();
return (
<form onSubmit={handleSubmit((data) => submitCostCalculator(data))}>
{/* Your custom form implementation */}
</form>
);
}
Learn more about field definitions in the json-schema-form documentation.
For a complete implementation example, see our example application.
We welcome contributions! If you're working on this package:
We have created an entry point in the package @remoteoss/remote-flows/internals
This entry endpoint exports internals utils and shadcn components to avoid duplicating these on the example folder.
We don't guarantee semver compatiblity if you used them in your project.
FAQs
[](https://www.npmjs.com/package/@remoteoss/remote-flows) [
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.