Modular mono repo for the Langfuse JS/TS client libraries.
Package | NPM | Environments |
---|---|---|
langfuse | Node >= 18, Web, Edge | |
langfuse-node | Node < 18 | |
langfuse-langchain | Node >= 20, Web, Edge |
This repository is broken into different packages
- /langfuse-core > All common code goes here.
- /langfuse-node > Node.js specific code
- /langfuse > Web/Edge/modern Node.js specific code, using fetch and browser APIs
- /langfuse-langchain > Langchain integration via callback handler
yarn
yarn test
Setup
- Start local langfuse server
- Create testing project
- Set environment: LF_HOST, LF_PUBLIC_KEY, LF_SECRET_KEY
Run
# Build SDKs
yarn build
# Run E2E test
yarn test:integration
Run npx lerna publish --force-publish --no-private
- Bumps version number of langfuse and langfuse-node, ignores langfuse-core
- Publishes to NPM, publishes also when there are no changes to keep the version numbers in sync
- Confirm with npmjs OTP
Thanks to the PostHog team for the awesome work on posthog-js-lite. This project is based on it as it was the best starting point to build a modular SDK repo to support various environments.