Trench provides a core set of fraud prevention tools to help you collect data on users, identify bad actors, and take action on them (e.g. blocking a payment).
You can deploy Trench in one click to Vercel or any hosting service.
You can send user events to Trench via the REST API or using the Javascript SDK.
curl \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
'YOUR_TRENCH_URL/api/event' \
-d '
{
"type": "payment",
"data": {
"card": {
"fingerprint": "f2xvb823k",
"brand": "visa",
"country": "US",
"last4": "4242",
},
"user": {
"id": "45912",
"name": "John Doe",
"email": "john@email.com"
},
...
}
Trench lets you automatically apply decisions to events and objects in your events like users and IP addresses. We use a modified version of SQRL, a rules language from Twitter, which lets you easily write rules with counts and aggregations that can be run on thousands of events per second with sub 100ms latency.
LET Card := entity('Card', jsonValue(EventData, '$.data.card.fingerprint'));
LET User := entity('User', jsonValue(EventData, '$.data.user.id'));
LET NumCards := countUnique(Card BY User LAST Week);
CREATE RULE UserUsedTooManyCards
WHERE NumCards > 4
WITH REASON "User ${User} used ${NumCards} in the last week";
WHEN UserUsedTooManyCards THEN
addEventLabel('$BLOCK', 'too many cards'),
addEntityLabel(User, '$BLOCKLIST', 'too many cards');
- Full customization. You know your product and user interactions better than anyone else. To be effective, you should have full control over the data you collect and integrate.
- Full access to your data. You shouldn’t be limited to dashboards and reports. Full access to your data is needed to properly understand your fraud.
- Clone the repository
- Go to dashboard project:
cd dashboard
- Install dependencies:
yarn
ornpm i
- Run the development server:
yarn dev
ornpm run dev
Join the Trench community in Discord if you need support or have anything you'd like to ask. We'd love to chat!