// Login
const loginResponse = await fetch('https://api.chessplay.io/api/token/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: 'your_username',
password: 'your_password'
})
});
const { access } = await loginResponse.json();
// Use token
const response = await fetch('https://api.chessplay.io/api/v1/students/', {
headers: { 'Authorization': `Bearer ${access}` }
});