Official JavaScript/TypeScript library for Entry on Kitchen API
npm install @endevre/entry-on-kitchenOfficial JavaScript/TypeScript library for executing recipes on the Entry on Kitchen API. Supports both synchronous execution and real-time HTTP streaming.

``bash`
npm install @endevre/entry-on-kitchen
`bash`
yarn add @endevre/entry-on-kitchen
`bash`
pnpm add @endevre/entry-on-kitchen
`typescript
import { KitchenClient } from "@endevre/entry-on-kitchen";
// Initialize the client
const client = new KitchenClient({
authCode: "your-auth-code-here",
entryPoint: "entry", // or "beta", "raydev", etc.
});
// Synchronous execution
const result = await client.sync({
recipeId: "your-recipe-id",
entryId: "your-entry-id",
body: { message: "Hello, Kitchen!" },
});
console.log(result);
`
`typescript`
new KitchenClient(config: KitchenClientConfig)
Parameters:
- authCode (string, required): Your X-Entry-Auth-Code for authenticationentryPoint
- (string, optional): Entry point environment. Defaults to "entry" (production)
Throws:
- Error if authCode is not provided
#### sync(params)
Execute a recipe synchronously and wait for the complete result.
Parameters:
- recipeId (string): The ID of the pipeline/recipeentryId
- (string): The ID of the entry blockbody
- (unknown): Request body data (object or JSON string)useKitchenBilling
- (boolean, optional): Enable Kitchen billingllmOverride
- (string, optional): Override the LLM model (e.g., "gpt-4", "claude-3")apiKeyOverride
- (object, optional): Override API keys for external services
Returns: Promise
`typescript
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: {
message: "Hello!",
provider: "google_genai",
model: "gemini-2.5-flash",
},
});
if (result._statusCode && result._statusCode !== 200) {
console.error("Error:", result.error);
} else {
console.log("Success:", result.result);
}
`
#### stream(params)
Execute a recipe with real-time streaming. Yields events as they arrive.
Parameters:
- recipeId (string): The ID of the pipeline/recipeentryId
- (string): The ID of the entry blockbody
- (unknown): Request body datauseKitchenBilling
- (boolean, optional): Enable Kitchen billingllmOverride
- (string, optional): Override the LLM model (e.g., "gpt-4", "claude-3")apiKeyOverride
- (object, optional): Override API keys for external services
Returns: AsyncIterable
Event Types:
- "progress": Execution progress updates"result"
- : Output data from blocks"delta"
- : Incremental content updates (for streaming LLM responses)"info"
- : Informational messages"end"
- : Final result (marks completion)
`typescript
for await (const event of client.stream({
recipeId: "abc123",
entryId: "def456",
body: { message: "Tell me a joke" },
})) {
const { type, data, socket } = event;
if (type === "progress") {
console.log(Progress: ${data.blockPosition}/${data.blocksToExitBlock});Result from ${socket}:
} else if (type === "result") {
console.log(, data);Delta update for ${socket}:
} else if (type === "delta") {
console.log(, data);`
} else if (type === "end") {
console.log("Complete!", data);
}
}
typescript
const client = new KitchenClient({
authCode: "your-auth-code",
entryPoint: "entry", // Uses https://entry.entry.on.kitchen
});
`$3
`typescript
const client = new KitchenClient({
authCode: "your-auth-code",
entryPoint: "beta", // Uses https://beta.entry.on.kitchen
});
`$3
`typescript
const client = new KitchenClient({
authCode: "your-auth-code",
entryPoint: "raydev", // Uses https://raydev.entry.on.kitchen
});
`Optional Features
$3
Enable Kitchen billing for your recipe execution:
`typescript
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: { message: "Hello!" },
useKitchenBilling: true,
});
`$3
Override the LLM model used in your recipe:
`typescript
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: { message: "Write a poem" },
llmOverride: "gpt-4",
});// Or with streaming
for await (const event of client.stream({
recipeId: "abc123",
entryId: "def456",
body: { message: "Write a poem" },
llmOverride: "claude-3",
})) {
// Handle events
}
`$3
You can use both options together:
`typescript
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: { message: "Hello!" },
useKitchenBilling: true,
llmOverride: "gpt-4",
});
`TypeScript Support
This library is written in TypeScript and includes full type definitions:
`typescript
import type {
KitchenClientConfig,
KitchenResponse,
SyncParams,
StreamParams,
StreamEvent,
StreamEventType,
} from "@endevre/entry-on-kitchen";
`Error Handling
`typescript
import { KitchenClient } from "@endevre/entry-on-kitchen";const client = new KitchenClient({
authCode: "your-auth-code",
});
try {
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: { message: "Hello!" },
});
// Check for error response
if (result._statusCode && result._statusCode !== 200) {
console.error("Request failed:", result.error);
return;
}
console.log("Success:", result.result);
} catch (error) {
console.error("Unexpected error:", error);
}
`Migration from v0.2.x
Version 0.3.0 is a breaking change from v0.2.x. See MIGRATION.md for detailed migration instructions.
$3
Before (v0.2.x):
`typescript
import { EntryBlock } from "entry-on-kitchen";const entry = new EntryBlock({
pipelineId: "abc123",
entryBlockId: "def456",
entryAuthCode: "your-auth-code",
entryPoint: "beta",
});
const result = entry.runSync({ message: "Hello!" });
const result = await entry.runAsync({ message: "Hello!" });
`After (v0.3.0):
`typescript
import { KitchenClient } from "@endevre/entry-on-kitchen";const client = new KitchenClient({
authCode: "your-auth-code",
entryPoint: "beta",
});
const result = await client.sync({
recipeId: "abc123",
entryId: "def456",
body: { message: "Hello!" },
});
// Or with streaming
for await (const event of client.stream({
recipeId: "abc123",
entryId: "def456",
body: { message: "Hello!" },
})) {
// Handle events
}
`Requirements
- Node.js 18 or higher
- Browser with native
fetch` support (or use a polyfill)ISC
For issues and questions: contact@endevre.com