https://github.com/hatchet-dev/hatchet-typescript-quickstart
Example workflows and setup instructions to use Hatchet with Typescript projects
https://github.com/hatchet-dev/hatchet-typescript-quickstart
Last synced: about 1 year ago
JSON representation
Example workflows and setup instructions to use Hatchet with Typescript projects
- Host: GitHub
- URL: https://github.com/hatchet-dev/hatchet-typescript-quickstart
- Owner: hatchet-dev
- Created: 2024-02-26T18:30:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-03T15:08:49.000Z (about 1 year ago)
- Last Synced: 2025-04-03T16:24:20.578Z (about 1 year ago)
- Language: TypeScript
- Size: 954 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hatchet First Workflow Example
This is an example project demonstrating how to use Hatchet with TypeScript. For detailed setup instructions, see the [Hatchet Setup Guide](https://docs.hatchet.run/home/setup).
## Prerequisites
Before running this project, make sure you have the following:
1. [Node.js v16 or higher](https://nodejs.org/en/download)
2. npm, yarn, or pnpm package manager
## Setup
1. Clone the repository:
```bash
git clone https://github.com/hatchet-dev/hatchet-typescript-quickstart.git
cd hatchet-typescript-quickstart
```
2. Set the required environment variable `HATCHET_CLIENT_TOKEN` created in the [Getting Started Guide](https://docs.hatchet.run/home/hatchet-cloud-quickstart).
```bash
export HATCHET_CLIENT_TOKEN=
```
> Note: If you're self hosting you may need to set `HATCHET_CLIENT_TLS_STRATEGY=none` to disable TLS
3. Install the project dependencies:
```bash
npm install
# or
yarn install
# or
pnpm install
```
### Running an example
1. Start a Hatchet worker:
```bash
npm run start
```
2. In a new terminal, run the example task:
```bash
npm run run:simple
```
This will trigger the task on the worker running in the first terminal and print the output to the second terminal.