You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logging HTTP requests sent to the core allows users to monitor what traffic they send to SuperTokens, avoid flooding it for no reason, and comply with the new rate limits.
This should be functional for users of SuperTokens SaaS as well as self-hosted.
Implementation details
(Please outline any details about how this feature would e implemented. If you don't know, you can just skip this section.)
We've added support for a hook that intercepts all outgoing traffic from the SDK. This can be used to intercept as well as modify the request to the core. This feature has been added in all three sdks:
Here's a node snippet for how to use it. Detailed docs for all sdks will be up soon.
importEmailPasswordfrom"supertokens-node/recipe/emailpassword";importSessionfrom"supertokens-node/recipe/session";import{HttpRequest}from"supertokens-node/types";SuperTokens.init({supertokens: {
connectionURI,// new hooknetworkInterceptor: (request: HttpRequest,userContext: any)=>{console.log("http request to core: ",request)returnrequest;// this can also return a modified request object.},},appInfo: {apiDomain: "api.supertokens.io",appName: "SuperTokens",websiteDomain: "supertokens.io",},recipeList: [EmailPassword.init(),Session.init()m],});
🚀 Feature
Logging HTTP requests sent to the core allows users to monitor what traffic they send to SuperTokens, avoid flooding it for no reason, and comply with the new rate limits.
This should be functional for users of SuperTokens SaaS as well as self-hosted.
Implementation details
(Please outline any details about how this feature would e implemented. If you don't know, you can just skip this section.)
Discord thread
https://discord.com/channels/603466164219281420/1166656686644277259
The text was updated successfully, but these errors were encountered: