Skip to content

Commit 667d04b

Browse files
committed
🐛 FIX: instantiation
1 parent cd16b3a commit 667d04b

File tree

5 files changed

+27
-11
lines changed

5 files changed

+27
-11
lines changed

ecosystem-tests/bun/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import {Workflow} from 'langbase';
1+
import {Langbase, Workflow} from 'langbase';
22

33
async function main() {
4-
const workflow = new Workflow({debug: true});
4+
const langbase = new Langbase({
5+
apiKey: 'YOUR_API_KEY', // Replace with actual API key or env var
6+
});
7+
const workflow = new Workflow({debug: true, langbase});
58
const result = await workflow.step({
69
id: 'hello',
710
run: async () => 'world',

ecosystem-tests/cf-worker/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import {Workflow} from 'langbase';
1+
import {Langbase, Workflow} from 'langbase';
22

33
export default {
44
async fetch(request: Request) {
5-
// Simple workflow step
6-
const workflow = new Workflow({debug: true});
5+
// Instantiate Langbase
6+
const langbase = new Langbase({
7+
apiKey: 'YOUR_API_KEY', // Replace with actual API key or env var
8+
});
9+
// Create workflow with langbase instance
10+
const workflow = new Workflow({debug: true, langbase});
711
const result = await workflow.step({
812
id: 'hello',
913
run: async () => 'world',

ecosystem-tests/deno/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// @deno-types="npm:[email protected]"
2-
import {Workflow} from 'npm:[email protected]';
2+
import {Langbase, Workflow} from 'npm:[email protected]';
33

44
async function main() {
5-
const workflow = new Workflow({debug: true});
5+
const langbase = new Langbase({
6+
apiKey: Deno.env.get('LANGBASE_API_KEY') ?? 'YOUR_API_KEY',
7+
});
8+
const workflow = new Workflow({debug: true, langbase});
69
const result = await workflow.step({
710
id: 'hello',
811
run: async () => 'world',

ecosystem-tests/node-cjs/index.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
const {Workflow} = require('langbase');
1+
const {Langbase, Workflow} = require('langbase');
22

33
async function main() {
4-
const workflow = new Workflow({debug: true});
4+
const langbase = new Langbase({
5+
apiKey: 'YOUR_API_KEY', // Replace with actual API key or env var
6+
});
7+
const workflow = new Workflow({debug: true, langbase});
58
const result = await workflow.step({
69
id: 'hello',
710
run: async () => 'world',

ecosystem-tests/node-esm/index.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import {Workflow} from 'langbase';
1+
import {Langbase, Workflow} from 'langbase';
22

33
async function main() {
4-
const workflow = new Workflow({debug: true});
4+
const langbase = new Langbase({
5+
apiKey: 'YOUR_API_KEY', // Replace with actual API key or env var
6+
});
7+
const workflow = new Workflow({debug: true, langbase});
58
const result = await workflow.step({
69
id: 'hello',
710
run: async () => 'world',

0 commit comments

Comments
 (0)