With Docker
#
Running the docker image 🚀- MySQL
- PostgreSQL
- MongoDB
docker run -p 3567:3567 -d registry.supertokens.io/supertokens/supertokens-mysql
- To see all the env variables available, please see the README file.
- The above command will start the container with an in-memory database. This means you do not need to connect it to MySQL to test out SuperTokens.
- When you are ready to connect it to your database, please visit the Database setup section
docker run -p 3567:3567 -d registry.supertokens.io/supertokens/supertokens-postgresql
- To see all the env variables available, please see the README file.
- The above command will start the container with an in-memory database. This means you do not need to connect it to PostgreSQL to test out SuperTokens.
- When you are ready to connect it to your database, please visit the Database setup section
docker run -p 3567:3567 -d registry.supertokens.io/supertokens/supertokens-mongodb
- To see all the env variables available, please see the README file.
- The above command will start the container with an in-memory database. This means you do not need to connect it to MongoDB to test out SuperTokens.
- When you are ready to connect it to your database, please visit the Database setup section
caution
We do not offer login functionality with MongDB yet. We only offer session management.
#
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 the container 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.
#
Connecting the backend SDK with SuperTokens 🔌- The default
port
for SuperTokens is3567
. You can change this by binding a different port in thedocker run
command. For example,docker run -p 8080:3567
will run SuperTokens on port8080
on your machine. - The connection info will go in the
supertokens
object in theinit
function on your backend:
- NodeJS
- GoLang
- Python
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 API keys section to see how to add one.
#
Helm charts for KubernetesFor MySQL image
For PostgreSQL image