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
How does it know how to store permanently the rate limiting stuff? Can I have multiple const aj = arcjet({...}) per project, like in theory one per route.ts?
That way, I can say "for this route, rate limit like this, for that route, rate limit this other way", etc..
Will that just work?
All of the sample apps only have 1 aj per app, so I'm not sure.
The text was updated successfully, but these errors were encountered:
Hi @lancejpollard ! Yes, you can have. multiple aj instances per app. We set it up like this so that we can have base rules that apply everywhere we use that instance, but then use withRule to apply per route rules. You don't have to use the same aj instance, but we do it because then we only need to instantiate the client once.
This has some performance benefits because we instantiate the bundled WebAssembly module when the client is created. There is also no shared local cache across instances so if a user gets blocked from one rule from one instance, there wouldn't be anything in the cache in another instance.
Hey @davidmytton, as in the pricing of Arcjet, it is mentioned that in the free plan we can use upto 5 rules, so if we create multiple instances , we can have 5 rules in each instance or just 5 rules in total ?
How does it know how to store permanently the rate limiting stuff? Can I have multiple
const aj = arcjet({...})
per project, like in theory one perroute.ts
?That way, I can say "for this route, rate limit like this, for that route, rate limit this other way", etc..
Will that just work?
All of the sample apps only have 1
aj
per app, so I'm not sure.The text was updated successfully, but these errors were encountered: