Skip to content

Your First App

Building your first Workrock app is easy. We provide a CLI to handle the boilerplate and authentication.

  • Node.js (v18 or higher)
  • A registered Partner account on the Marketplace.

Install our command-line tool globally:

Terminal window
npm install -g @workrock/cli

Link your machine to your developer account:

Terminal window
workrock login

This will open your browser to authenticate.

We recommend starting with a Next.js application:

Terminal window
npx create-next-app@latest my-workrock-app --typescript --tailwind --eslint
cd my-workrock-app

Connect your local folder to an app ID registered in the Marketplace:

Terminal window
workrock link

Follow the prompts to select your application. This creates a workrock.json file.

To run your app locally and access the Workrock Core API, you need a Sandbox and a Development Token.

This creates an isolated environment seeded with mock data (Projects, Leads, Tasks):

Terminal window
workrock sandbox --create "My Dev Store"
  1. Get your Auth Token: Run this CLI command to see your token:
    Terminal window
    cat ~/.workrock/config.json
  2. Create .env.local: Create a file named .env.local in your project root:
    # Points to Workrock Core API
    NEXT_PUBLIC_API_URL=http://localhost:8000
    # Allows bypassing iframe check for localhost development
    # (Copy the 'token' value from config.json)
    NEXT_PUBLIC_WORKROCK_DEV_TOKEN=eyJhbGciOi...

Start the development server with the Workrock CLI wrapper:

Terminal window
workrock dev

You 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.