https://supertokens.com/ logo
#general
Title
# general
r

rp

01/12/2022, 1:25 PM
@User first you want to enable the JWT feature like shown here: https://supertokens.io/docs/thirdpartyemailpassword/common-customizations/sessions/with-jwt/enabling-jwts Then you can create JWTs like:
Copy code
session.CreateJWT(map[string]interface{}{
        "customKey1": "customValue1",
        "customKey2": "customValue2",
        // other JWT claims
    }, nil)
The second param is the validity in seconds. By default, it is the access token lifetimes + 30 seconds. But if you want it really long, you can set it to some 100 years (in second) or something.. This is the function signature: https://pkg.go.dev/github.com/supertokens/supertokens-golang@v0.3.5/recipe/session#CreateJWT Then you can follow these docs for verification of JWT in your APIs: https://supertokens.io/docs/thirdpartyemailpassword/common-customizations/sessions/with-jwt/jwt-verification