Skip to main content

Binary Installation

1) Download SuperTokens#

  • Visit the open source download page.
  • Click on the "Binary" tab.
  • Choose your database.
  • Download the SuperTokens zip file for your OS.

Once downloaded, extract the zip, and you will see a folder named supertokens.

2) Install SuperTokens#

# sudo is required so that the supertokens 
# command can be added to your PATH variable.

cd supertokens
sudo ./install
important

After installing, you can delete the downloaded folder as you no longer need it.

Any changes to the the config will be done in the config.yaml file in the installation directory, the location of which is specified in the output of the supertokens --help command.

3) Start SuperTokens ๐Ÿš€#

Running the following command will start the service.

supertokens start [--host=...] [--port=...]
  • The above command will start the container with an in-memory database.
  • When you are ready to connect it to your database, please visit the Database setup section
  • To see all available options please run supertokens start --help

4) Testing that the service is running ๐Ÿคž#

Open a browser and visit http://localhost:3567/hello. If you see a page that says Hello back, then SuperTokens was started successfully!

If you are having issues with starting the docker image, please feel free to reach out to us over email or via Discord.

5) Stopping SuperTokens ๐Ÿ›‘#

supertokens stop

Connecting the backend SDK with SuperTokens ๐Ÿ”Œ#

  • The default host and port for SuperTokens is localhost:3567. You can change this by passing --host and --port options to the start command.
  • The connection info will go in the supertokens object in the init function on your backend:
import supertokens from "supertokens-node";

supertokens.init({
supertokens: {
connectionURI: "http://localhost:3567",
apiKey: "someKey" // OR can be undefined
},
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: []
});

Security

There is no API key by default. Visit the "Auth flow customization" -> "SuperTokens Core customizations" -> "Adding API Keys" section to see how to add one.