Skip to content

Commit 8f63385

Browse files
Improve docs for world-postgres and web (#145)
1 parent 1223721 commit 8f63385

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

.changeset/hungry-cats-rush.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@workflow/web-shared": patch
3+
"@workflow/web": patch
4+
---
5+
6+
Add readme section about self-hosting observability UI

packages/web-shared/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ Workflow Observability tools for NextJS. See [Workflow DevKit](https://useworkfl
44

55
## Usage
66

7-
This package contains client and server code to interact with the Workflow API.
8-
You can use it like so to display your own runs list:
7+
This package contains client and server code to interact with the Workflow API, as well as some pre-styled components.
8+
If you want to deploy a full observability experience with your NextJS app, take a look at [`@workflow/web`](../web/README.md) instead, which can be self-hosted.
9+
10+
You can use the API to create your own display UI, like so:
911

1012
```tsx
1113
import { useWorkflowRuns } from '@workflow/web-shared';

packages/web/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# @workflow/web
22

33
Observability Web UI Package bundled in the [Workflow DevKit](https://useworkflow.dev/docs/observability).
4+
5+
## Self-hosting
6+
7+
While this UI is bundled with the Workflow CLI, you can also self-host it by cloning this repository and
8+
deploying it like any other NextJS app.
9+
10+
For API calls to work, you'll need to pass the same environment variables to the NextJS app that are
11+
used by the Workflow CLI. See `npx workflow inspect --help` for more information on the available environment variables.
12+
13+
If you're deploying this to Vercel, setting `WORKFLOW_TARGET_WORLD` to `vercel` is enough
14+
to infer your other project details. Note that observability will be scoped to the project
15+
and environment you're deploying to.

packages/world-postgres/src/cli.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
#!/usr/bin/env node
2-
3-
import { config } from 'dotenv';
41
import { readFile } from 'node:fs/promises';
52
import { dirname, join } from 'node:path';
63
import { fileURLToPath } from 'node:url';
4+
import { config } from 'dotenv';
75
import postgres from 'postgres';
86

97
const __dirname = dirname(fileURLToPath(import.meta.url));

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)