getPromptStateless received 403 error when using LangfuseWeb
SDK
#3977
Answered
by
marcklingen
huangbaitu123
asked this question in
Support
-
import { LangfuseWeb } from "langfuse"
const langfuseweb = new LangfuseWeb({
publicKey: process.env.LANGFUSE_PUBLIC_KEY,
baseUrl: process.env.LANGFUSE_BASEURL,
})
langfuseweb.getPromptStateless("ai-tools-dev-test").then((res) => {
res.data === {
message: 'Access denied - need to use basic auth with secret key to GET prompts',
error: 'ForbiddenError'
}
}
}) LangfuseWeb do not accept secretKey, but getPromptStateless needs basic auth, so this is paradox? |
Beta Was this translation helpful? Give feedback.
Answered by
marcklingen
Oct 31, 2024
Replies: 1 comment
-
Thanks for the feedback, I'll create an issue as this is confusing and could be improved, thanks again for the feedback! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
marcklingen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the feedback,
getPromptStateless
is an internal method which is not documented. You need to useimport { Langfuse } from "langfuse"
and authenticate with secret and public key to usegetPrompt()
. See this documentation section for more details: https://langfuse.com/docs/prompts/get-started#use-promptI'll create an issue as this is confusing and could be improved, thanks again for the feedback!