Discussions
Avatar StartSession getting error: code":400112,"message":"Unauthorized"
3 months ago by Alejandro
async function startSession() {
const newToken = await token();
console.log(newToken);
const avatar = new StreamingAvatar({ token: newToken });
console.log(avatar);
const startRequest: StartAvatarRequest = {
quality: AvatarQuality.Low,
avatarName: "....",
voice: {
voiceId: "DaRRknkmrMrdxKh7LVRm",
rate: 1.5, // 0.5 ~ 1.5
emotion: VoiceEmotion.EXCITED,
}
};
const sessionData = await avatar.newSession(startRequest);
console.log(sessionData.session_id);
avatar.stopAvatar();
}
We are trying to use the sdk in backed with this error. We dont have the problem in frontend.