Git Product home page Git Product logo

langfuse-js's Introduction

langfuse-js

MIT License CI test status GitHub Repo stars Discord YC W23

Modular mono repo for the Langfuse JS/TS client libraries.

Packages

Important

The SDK was rewritten in v2 and released on December 18, 2023. Refer to the v2 migration guide for instructions on updating your code.

Package NPM Environments
langfuse npm package Node >= 18, Web, Edge
langfuse-node npm package Node < 18
langfuse-langchain npm package Node >= 20, Web, Edge

Documentation

โ†’ docs.langfuse.com

Development

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

Installing dependencies

yarn

Running tests

yarn test

Integration test

Setup

  1. Start local langfuse server
  2. Create testing project
  3. Set environment: LF_HOST, LF_PUBLIC_KEY, LF_SECRET_KEY

Run

# Build SDKs
yarn build

# Run E2E test
yarn test:integration

Publishing a new version

git clean -fdx -e node_modules -e .env
yarn
yarn build

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

Alpha: npx lerna publish prerelease --force-publish --no-private --dist-tag alpha --preid alpha

Write release notes in GitHub releases.

License

MIT

Credits

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.

langfuse-js's People

Contributors

marcklingen avatar maxdeichmann avatar ksjogo avatar charlypoly avatar nicou avatar richardkruemmel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.