Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
Fixed Clay webhook authentication by making the auth token optional and correcting the header name from Authorization: Bearer to x-clay-webhook-auth.
Key Changes
- Made
authTokenparameter optional across block UI and tool configuration - Corrected authentication header from
Authorization: Bearertox-clay-webhook-authper Clay's API requirements - Enhanced response output to include metadata (status, headers, timestamp, content type)
- Updated UI descriptions to clarify that auth tokens are only needed when webhook authentication is enabled
Issues Found
- TypeScript type mismatch:
apps/sim/tools/clay/types.tswasn't updated to include the newmetadatafield inClayPopulateResponse, causing type safety issues
Confidence Score: 3/5
- This PR fixes critical authentication issues but has a type safety bug that needs resolution before merge
- The core logic changes are correct and well-implemented (fixing auth header, making token optional), but the TypeScript types in
types.tsweren't updated to match the new output structure with metadata field, which will cause type errors at compile time - The missing file
apps/sim/tools/clay/types.tsneeds to be updated to include the metadata field in ClayPopulateResponse interface
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/blocks/blocks/clay.ts | 5/5 | Made auth token optional with clear description - UI changes look good |
| apps/sim/tools/clay/populate.ts | 4/5 | Fixed header name and made auth optional, added metadata output - TypeScript types need update |
Sequence Diagram
sequenceDiagram
participant User
participant ClayBlock as Clay Block UI
participant ClayTool as Clay Populate Tool
participant ClayAPI as Clay Webhook API
User->>ClayBlock: Configure webhook URL & data
opt Auth Token Provided
User->>ClayBlock: Enter auth token (optional)
end
User->>ClayBlock: Trigger populate action
ClayBlock->>ClayTool: Call clay_populate(webhookURL, data, authToken?)
ClayTool->>ClayTool: Build headers (Content-Type)
alt authToken exists and not empty
ClayTool->>ClayTool: Add x-clay-webhook-auth header
end
ClayTool->>ClayAPI: POST request with data
ClayAPI-->>ClayTool: Response (JSON or text)
ClayTool->>ClayTool: Extract headers & metadata
ClayTool->>ClayTool: Parse response body
ClayTool->>ClayTool: Build output with data & metadata
ClayTool-->>ClayBlock: Return {data, metadata}
ClayBlock-->>User: Display response with metadata
Additional Comments (1)
-
apps/sim/tools/clay/types.ts, line 9-13 (link)logic: The
ClayPopulateResponsetype is missing themetadatafield that was added to the tool's output. The response now includes bothdataandmetadatafields.
2 files reviewed, 1 comment
2db83be to
00af6b5
Compare
This was referenced Oct 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Made clay auth token optional, and fixed header
Type of Change
Testing
Tested with and without clay auth token
Checklist
Screenshots/Videos
Screen.Recording.2025-10-24.at.3.13.13.PM.mov