Tosh Velaga
Tosh Velaga•4mo ago

Demo of JS SDK Issue

@hassiebp Hey just wanted to record a loom video to show that the js sdk doesn't seem to be captuing traces, while the python one is. https://www.loom.com/share/984a0aa15e1647359e2e8e80ca39e8f3?sid=fff3abf7-9f98-4837-9003-a099a4897671
Loom
Demo of JS SDK Issue
Hey guys, in this video, I'm demonstrating an issue with the JS SDK. I'll show you that the Python code works fine, but the JS code doesn't log the trace as expected. I've provided the code from the documentation, but it's not working. I've also set up the necessary environment variables. I would appreciate your help in figuring out why the JS c...
2 Replies
hassiebp
hassiebp•4mo ago
Hi @Tosh Velaga - that is likely due to a missing flush. Please note that in short-lived environments you'll need to call await openai.flushAsync() (where openai is the wrapped openai client) before shutdown to send the events. Could you check this out and let us know if that solves it for you? 🙂 https://langfuse.com/docs/sdk/typescript/guide#lambda
JS/TS SDK - Langfuse
Fully async and typed SDK, runs in Node.js, edge, Deno
Tosh Velaga
Tosh Velaga•4mo ago
@hassiebp Thanks so much this worked! Greatly appreciate it 🙂