---
title: Fastify integration
description: "Tracks signups and sales from a Fastify backend, including sales from your own Stripe webhook."
type: integration
url: "https://affitor.com/integrations/fastify"
index: "https://affitor.com/llms.txt"
---

# Fastify

> Tracks signups and sales from a Fastify backend, including sales from your own Stripe webhook.

## What it does

- A script tag on your frontend stores the click in a first-party cookie.
- Your server sends each lead and each sale, with your own user ID.
- Your own Stripe webhook route gets the raw body, so Stripe’s signature check passes.
- With Stripe connected to Affitor, don’t call `trackSale` there: Affitor records the sales itself.

## Set up in three steps

1. Add the Affitor script tag to your frontend, and send the click ID with your signup form.
2. Call `trackLead` when you create the user, and add Affitor metadata to the Checkout Session.
3. Give the Stripe webhook route a raw-body parser, then call `trackSale` from it.

Read the full guide: [Fastify guide](https://affitor.com/docs/api-reference/integrations/node-express)

- Category: Frameworks and auth
- Works with: Fastify, Stripe Checkout, Stripe webhooks
- Package: @affitor/sdk, in beta
- Docs: [Fastify guide](https://affitor.com/docs/api-reference/integrations/node-express)

## More integrations

- [Node.js and Express](https://affitor.com/integrations/node-express): Signups and sales from your Express server
- [Stripe](https://affitor.com/integrations/stripe): Checkout and subscriptions, credited to the partner
- [Next.js](https://affitor.com/integrations/nextjs): Track signups in a Next.js app
