This SDK documentation is outdated. Please do not refer to it, and instead visit the User Guides section.

Skip to main content
Version: 8.2.X

Submitting form data

Traditionally, when submitting form data, the browser makes an API call for you to submit the data.

With SuperTokens, you will have to make this API call yourself so that correct session interception is added.


<form onsubmit="return submitData()">
Enter name: <input type="text" name="fname">
<input type="submit" value="Submit">

supertokens.init(/* params.. */); // initialise SuperTokens

function submitData() {
// extract element out of the user input field and call API using fetch or axios

return false; // will prevent any redirection that happens when a form is submitted.

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI