RolloutConnectProvider
Description#
Rollout Connect components require certain context to be provided via RolloutConnectProvider.
You can put this at the root of your React tree, or just wrap any component that requires it.
Import#
import { RolloutConnectProvider } from "@rollouthq/connect-react";
Usage#
Here's a basic usage example:
function App() {// token can be string, or a function to get it<RolloutConnectProvider token={token}><MyAutomationsonCreateAutomation={() => navigate("create")}onEditAutomation={(automation) => navigate(`${automation.id}/edit`)}/></RolloutConnectProvider>}
Props#
| prop | type | required | default | Description |
|---|---|---|---|---|
token | string | function | true | - | Token to authenticate the end user, or a callback function to get one. Is called before first request is made and in case token expires. |
apiBaseUrl | string | false | - | URL to the Rollout HQ api endpoint. |