Step 1of 2
Getting Started
Install the Construct SDK to build, validate, and publish Constructs from the command line.
Prerequisites
Node.js 18 or later
npm, yarn, or pnpm package manager
A Work Runner account (apply at usework.app/runner)
Install the SDK
The Construct SDK provides everything you need to build and publish Constructs:
$ npm install -g @useworkapp/construct-sdk
Or use npx to run commands without global installation.
Create a New Construct
Initialize a new Construct project with the SDK:
$ npx @useworkapp/construct-sdk init "My Expense Tracker" Creating construct "My Expense Tracker"... ✓ Created my-expense-tracker/ ├── App.tsx # Your React component ├── construct.json # Metadata and config └── .gitignore $ cd my-expense-tracker
Project Structure
The SDK creates a complete development environment:
my-expense-tracker/
├── construct.json # Metadata, tags, and config
├── package.json # Dependencies
├── index.html # Entry HTML
├── vite.config.ts # Vite configuration
├── tailwind.config.js # Tailwind CSS config
├── tsconfig.json # TypeScript config
└── src/
├── App.tsx # Your main component
├── main.tsx # React entry point
├── index.css # Global styles
├── lib/
│ └── utils.ts # Utility functions
└── components/
└── ui/ # shadcn/ui components
├── button.tsx
├── card.tsx
├── input.tsx
└── label.tsxRun npm install then npm run dev to start the local dev server.
Configure construct.json
The config file describes your Construct for discovery and deployment:
{
"name": "My Expense Tracker",
"version": "1.0.0",
"description": "Track daily expenses with automatic totals",
"entry": "src/App.tsx",
"intent_tags": {
"domains": ["finance", "personal"],
"app_types": ["tracker", "list"],
"actions": ["track", "add", "delete"],
"keywords": ["expense", "money", "budget"]
},
"pwa": {
"theme_color": "#000000",
"background_color": "#ffffff"
}
}Intent Tags
Tags help users discover your Construct. Be specific - good tags improve matching.
- • domains: Category (finance, health, productivity, etc.)
- • app_types: What it is (tracker, calculator, list, etc.)
- • actions: What users can do (track, add, calculate, etc.)
- • keywords: Search terms users might use
SDK Commands
The SDK provides these commands for the full build-to-publish workflow:
| Command | Description |
|---|---|
| init <name> | Create a new construct project |
| validate [dir] | Check construct meets all requirements |
| login | Authenticate with your Work account |
| publish [dir] | Upload construct to Work platform |
| submit <id> | Submit for review |
| deploy <id> | Deploy as PWA (after approval) |
| list | List your constructs |
Validate Before Publishing
Always validate your Construct before publishing to catch issues early:
$ npx @useworkapp/construct-sdk validate Validating construct... ✓ App.tsx exists ✓ Default export found ✓ Using allowed imports only ✓ No external API calls ✓ Data persistence implemented ✓ Accessibility attributes present ✓ Construct passes all validations!
Quick Reference: Full Workflow
# 1. Create a new construct npx @useworkapp/construct-sdk init "My App" cd my-app # 2. Build your app in App.tsx # (use your favorite editor or AI coding tool) # 3. Validate before publishing npx @useworkapp/construct-sdk validate # 4. Login to your Work account npx @useworkapp/construct-sdk login # 5. Publish to Work platform npx @useworkapp/construct-sdk publish # Returns: construct ID (e.g., abc123) # 6. Submit for review npx @useworkapp/construct-sdk submit abc123 # 7. After approval, deploy as PWA npx @useworkapp/construct-sdk deploy abc123 # Returns: https://my-app-abc123.apps.usework.app