1const api = 'your api';
2const token = JSON.parse(sessionStorage.getItem('data'));
3const token = user.data.id; /*take only token and save in token variable*/
4axios.get(api , { headers: {"Authorization" : `Bearer ${token}`} })
5.then(res => {
6console.log(res.data);
7.catch((error) => {
8 console.log(error)
9});