Widgetbook Hosting
Widgetbook Hosting enables users to upload the Flutter web version of a Widgetbook to Widgetbook Cloud. To upload any Widgetbook, you need an API key.
How to Create an API Key
- Log in to Widgetbook Cloud with your account.
- API keys are tied to projects, so you need a project to obtain an API key.
- Only users with the
Owner
role can fetch a project's API key to protect sensitive information. - If you are not a project owner but need the API key, ask your project owner to promote you from member to owner. For more information on member management, see Member Management.
- To create a new project, create a billing account first.
- On the project's detail page, a card with a button to fetch the API key is displayed. Click the button to copy the API key to your clipboard.
Hosting with CI/CD Vendors
To upload a Widgetbook Build and create Reviews in your CI/CD pipeline, follow these steps:
- Install the Flutter SDK.
- Run the
build_runner
package:flutter pub run build_runner build --delete-conflicting-outputs
. - Build your Widgetbook:
flutter build web -t path/to/widgetbook/main/file
. - Activate the Widgetbook CLI:
dart pub global activate widgetbook_cli
. - Run the CLI as described in the documentation.
Examples
Is your CI/CD vendor missing? Let us know via Discord, and we'll be happy to help.
Are you using BitBucket? You can read more here
Environment Variables
The Docker image reads Git-specific information, like branch name and repository name, from environment variables. It also requires two mandatory user-provided environment variables. In BitBucket, add repository variables by navigating to the repository settings and selecting repository variables.
Environment Variable | Description | Is Required |
---|---|---|
WIDGETBOOK_BUILD_PATH | The path to the web build of the Widgetbook. For small repositories, this is likely build/web/ . | ✅ |
WIDGETBOOK_API_KEY | The API key for your company. See How to Create an API Key | ✅ |