Your First App
Building your first Workrock app is easy. We provide a CLI to handle the boilerplate and authentication.
Prerequisites
Section titled “Prerequisites”- Node.js (v18 or higher)
- A registered Partner account on the Marketplace.
1. Install the CLI
Section titled “1. Install the CLI”Install our command-line tool globally:
npm install -g @workrock/cli2. Authenticate
Section titled “2. Authenticate”Link your machine to your developer account:
workrock loginThis will open your browser to authenticate.
3. Create a Project
Section titled “3. Create a Project”We recommend starting with a Next.js application:
workrock createcd my-workrock-app4. Link to Marketplace
Section titled “4. Link to Marketplace”Connect your local folder to an app ID registered in the Marketplace:
workrock linkFollow the prompts to select your application. This creates a workrock.json file.
5. Configure Development Environment
Section titled “5. Configure Development Environment”To run your app locally and access the Workrock Core API, you need a Sandbox and a Development Token.
Create a Sandbox
Section titled “Create a Sandbox”This creates an isolated environment seeded with mock data (Projects, Leads, Tasks):
workrock sandbox --create "My Dev Store"Set up Environment Variables
Section titled “Set up Environment Variables”- Get your Auth Token: Run this CLI command to see your token:
Terminal window cat ~/.workrock/config.json - Update
workrock-config.ts: Update theworkrock-config.tsfile in your project (src/config/workrock-config.ts) with your API URL and Development Token (obtained from Marketplace Dashboard):export const workrockConfig = {apiURL: "WORKROCK_API_URL_HERE",devToken: "WORKROCK_DEV_TOKEN_HERE",}
6. Run the App
Section titled “6. Run the App”Start the development server with the Workrock CLI wrapper:
workrock devYou can now open http://localhost:3000 to verify your app is running and fetching data from the API!
Note: When you are ready to test within the Workrock OS iframe, the CLI automatically tunnels your localhost to the platform.