Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions docs/tutorials/develop-from-scratch/step-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ This step establishes the foundational database schema for your project manageme
```typescript {{title: 'tailor.config.ts'}}
import { defineConfig } from "@tailor-platform/sdk";

if (!process.env.WORKSPACE_ID) {
throw new Error("WORKSPACE_ID environment variable is not set");
}

export default defineConfig({
workspaceId: process.env.WORKSPACE_ID,
name: "project-management",
db: { "main-db": { files: [`./src/db/*.ts`] } },
});
Expand Down Expand Up @@ -138,10 +133,13 @@ project-management/

## Deploy

The workspace is provided at deploy time, not in `tailor.config.ts`. Pass it via the `TAILOR_PLATFORM_WORKSPACE_ID` environment variable (or the `--workspace-id` flag). On the first deploy, the SDK injects a stable `id` into `tailor.config.ts` to track the application across renames — keep it under version control.

```bash
npm install
export WORKSPACE_ID=your-workspace-id
export TAILOR_PLATFORM_WORKSPACE_ID=your-workspace-id
npm run deploy
# or: npm run deploy -- --workspace-id your-workspace-id
```

## Next Step
Expand Down
5 changes: 0 additions & 5 deletions docs/tutorials/develop-from-scratch/step-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ This step adds authentication capabilities to your project management applicatio
import { defineAuth, defineConfig } from "@tailor-platform/sdk";
import { user } from "./src/db/user";

if (!process.env.WORKSPACE_ID) {
throw new Error("WORKSPACE_ID environment variable is not set");
}

export default defineConfig({
workspaceId: process.env.WORKSPACE_ID,
name: "project-management",
db: { "main-db": { files: [`./src/db/*.ts`] } },
auth: defineAuth("main-auth", {
Expand Down
5 changes: 0 additions & 5 deletions docs/tutorials/develop-from-scratch/step-03.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ Changes from Step 2: added `admin` machine user, `resolver` namespace, and `gene
import { defineAuth, defineConfig, defineGenerators } from "@tailor-platform/sdk";
import { user } from "./src/db/user";

if (!process.env.WORKSPACE_ID) {
throw new Error("WORKSPACE_ID environment variable is not set");
}

export default defineConfig({
workspaceId: process.env.WORKSPACE_ID,
name: "project-management",
db: { "main-db": { files: [`./src/db/*.ts`] } },
auth: defineAuth("main-auth", {
Expand Down
9 changes: 2 additions & 7 deletions docs/tutorials/develop-from-scratch/step-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ Only change from Step 3: added `executor` to `tailor.config.ts`.
import { defineAuth, defineConfig, defineGenerators } from "@tailor-platform/sdk";
import { user } from "./src/db/user";

if (!process.env.WORKSPACE_ID) {
throw new Error("WORKSPACE_ID environment variable is not set");
}

export default defineConfig({
workspaceId: process.env.WORKSPACE_ID,
name: "project-management",
db: { "main-db": { files: [`./src/db/*.ts`] } },
auth: defineAuth("main-auth", {
Expand Down Expand Up @@ -50,7 +45,7 @@ export const generators = defineGenerators([
]);
```

`createExecutor` takes an object config with `name`, `trigger`, and `operation`. The trigger `recordCreatedTrigger` takes `{ type: task }`. Available trigger context: `newRecord` (created), `oldRecord`/`newRecord` (updated), `record` (deleted).
`createExecutor` takes an object config with `name`, `trigger`, and `operation`. The trigger `recordCreatedTrigger` takes `{ type: task }`. Available trigger context: `newRecord` (created), `oldRecord`/`newRecord` (updated), `oldRecord` (deleted).

```typescript {{title: 'src/executor/newTaskSlackNotification.ts'}}
import { createExecutor, recordCreatedTrigger } from "@tailor-platform/sdk";
Expand All @@ -68,7 +63,7 @@ export default createExecutor({
headers: {
"Content-Type": "application/json",
},
body: ({ newRecord }) => ({
requestBody: ({ newRecord }) => ({
text: "New Task created :tada: " + newRecord.name,
}),
},
Expand Down
Loading