fetch all users via sdk/api #2975
Replies: 3 comments 1 reply
-
Hey @vincent-larisma! I'm here to help you with any bugs, questions, or contributions you have in mind. Let's work together to tackle this issue! There is no specific endpoint or method in the Here is an example of how you can fetch user data for a specific user ID using the import { Langfuse } from "langfuse";
const langfuse = new Langfuse({
publicKey: "your_public_key",
secretKey: "your_secret_key",
baseUrl: "https://cloud.langfuse.com" // or "https://us.cloud.langfuse.com" for the US region
});
async function fetchUserData(userId) {
try {
const trace = await langfuse.trace({
userId: userId // Replace with actual user ID
});
if (trace) {
console.log(trace);
// You can now use trace to showcase user data on your website
} else {
console.error("Failed to fetch user data");
}
} catch (error) {
console.error("Error fetching user data:", error);
}
}
// Example usage
const userIds = ["user-id-1", "user-id-2", "user-id-3"]; // Replace with actual user IDs
userIds.forEach(fetchUserData); In this example:
This code will fetch the user data for each user ID and log it to the console. You can then use the |
Beta Was this translation helpful? Give feedback.
-
Hi @vincent-larisma, currently there is not method yet to fetch users from Langfuse. I made this an idea post, this is great, thank you! |
Beta Was this translation helpful? Give feedback.
-
Is there any progress on this @marcklingen? |
Beta Was this translation helpful? Give feedback.
-
i need to get all the data that is in all of the users on my project using the sdk to showcase the data to my website. no documentation in getting users found
Beta Was this translation helpful? Give feedback.
All reactions