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- Linux
- Mac
- Windows
# sudo is required so that the supertokens
# command can be added to your PATH variable.
cd supertokens
sudo ./install
cd supertokens
./install
caution
You may get an error like java cannot be opened because the developer cannot be verified
. To solve this, visit System Preferences > Security & Privacy > General Tab, and then click on the Allow button at the bottom. Then retry the command above.
Rem run as an Administrator. This is required so that the supertokens
Rem command can be added to your PATH.
cd supertokens
install.bat
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
andport
for SuperTokens islocalhost:3567
. You can change this by passing--host
and--port
options to thestart
command. - The connection info will go in the
supertokens
object in theinit
function on your backend:
- NodeJS
- GoLang
- Python
- Other Frameworks
Important
import supertokens from "supertokens-node";
supertokens.init({
supertokens: {
connectionURI: "http://localhost:3567",
apiKey: "someKey" // OR can be undefined
},
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: []
});
import "github.com/supertokens/supertokens-golang/supertokens"
func main() {
supertokens.Init(supertokens.TypeInput{
Supertokens: &supertokens.ConnectionInfo{
ConnectionURI: "http://localhost:3567",
APIKey: "someKey",
},
})
}
from supertokens_python import init, InputAppInfo, SupertokensConfig
init(
app_info=InputAppInfo(api_domain="...", app_name="...", website_domain="..."),
supertokens_config=SupertokensConfig(
connection_uri='http://localhost:3567',
api_key='someKey'
),
framework='...',
recipe_list=[
#...
]
)
Security
There is no API key by default. Visit the "Auth flow customization" -> "SuperTokens core settings" -> "Adding API Keys" section to see how to add one.