api_key - Specify any one of the API keys that you have set in the config.yaml
There are more config values in the config.yaml file (for on premise) or on the SaaS dashboard. The values you set via the init function above will override those.
2) Create a refresh API
This API will be used to get new access and refresh tokens (done automatically from our frontend SDK).
Simply add supertokens_session dependency using Depends in the api.
from supertokens_fastapi import supertokens_session, Session
from fastapi import Depends
@app.post('/session/refresh')asyncdefrefresh(refresh_session: Session = Depends(supertokens_session)):return {} # send response
3) Error handling
By default, SuperTokens takes care of handling session errors for you. However, you can define your own logic as well.