···11-# Log Drains
22-# add from the first form - 'x-vercel-verify'
33-INTEGRATION_SECRET=
44-# after verify, in the modal box - 'x-vercel-signature'
55-LOG_DRAIN_SECRET=
66-77-88-# Marketplace Integration
99-VERCEL_CLIENT_ID=
1010-VERCEL_CLIENT_SECRET=
1111-VERCEL_REDIRECT_URI=
1212-AES_KEY=
-60
packages/integrations/vercel/README.md
···11-# Log drain integration for Vercel
22-33-Seamless installement into Vercel's log drains for your project.
44-55-> Inspired by
66-> [@valeriangalliat/vercel-custom-log-drain](https://github.com/valeriangalliat/vercel-custom-log-drain).
77-88-## Description
99-1010-When integrating the Vercel App into your project. Every request to
1111-[openstatus.dev](https://openstatus.dev) will include the key inside of the
1212-`Headers`.
1313-1414-Once we have the `access_token` token we will be able to `createLogDrain` as
1515-authentificated user. The token is only expires after 30 minutes and is required
1616-for the user to access the integration within vercel.
1717-1818-When creating the log drain, we should include a custom header to it, with an
1919-`OpenStatus-Vercel-TOKEN: "os_xxx-yyy"` token from Unkey. That way, it is easy
2020-to revoke tokens. We can test without but should include it. Check with Andreas
2121-how a good use case an look like.
2222-2323-The new created log drain will point towards our `/api/integrations/vercel`. We
2424-will then be able to filter them and ingest Tinybird the the logs we want to
2525-keep. Maybe, we can start first by ingesting only errors.
2626-2727-1. We can start simple an only create the log drain for the user. nothing else
2828-2. Once clear we will have to create a little `/configure` page where the user,
2929- authentificated within vercel, can update the log drain integration easily.
3030-3131-The UI for the Integration should be the bare minimum. The UX should be in the
3232-focus. Default shadcn/ui components will do it.
3333-3434-- white background
3535-- `DataTable` filled with `getLogDrains` data:
3636- - createdAt
3737- - name
3838- - projectId
3939- - dropdown menu: data can be deleted
4040-- 'Connect'-button to add log drains to different projet
4141-4242-<!-- Redirect URL aka callback explaination -->
4343-4444-### Files
4545-4646-- `webhook.ts`: ingests Tinybird with the log drains
4747-- `callback.ts`: callback for getting an access token
4848-- `configure.ts`: simple page to configure your vercel integration authorized as
4949- vercel user through access token
5050-- `client.ts`: includes all important REST API calls to vercel, updating the
5151- users project
5252-5353-### API Scopes
5454-5555-The following scopes are necessary:
5656-5757-- Log Drains (Read/Write): be able to send a request with the payload
5858-- Projects (Read): connect log drains with projects
5959-6060-> We might require more scopes.