-
Notifications
You must be signed in to change notification settings - Fork 31
chore: add customer email config to sdk #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore: add customer email config to sdk #62
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 4 files
Confidence score: 3/5
- Misspelling the environment variable for
secretKeyinnextjs/sdk.tsmeans the SDK will seeundefined, leading to failed authentication and clear user impact. - Given this auth regression risk, merging as-is feels uncertain even though the rest of the PR looks straightforward.
- Pay close attention to
nextjs/sdk.ts- environment variable typo breaks secret loading.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="nextjs/sdk.ts">
<violation number="1" location="nextjs/sdk.ts:8">
P1: `secretKey` now reads from a misspelled environment variable, so the SDK will receive `undefined` and fail to authenticate.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Summary by cubic
Adds a customer-level email receipt toggle to the SDK via send_email_receipts on create and update. Supports ENG-1022 by letting apps control receipt emails per customer without breaking existing calls.
New Features
Bug Fixes
Written for commit ddd0df0. Summary will update on new commits.
Greptile Overview
Greptile Summary
This PR adds support for configuring customer email receipts through a new
send_email_receiptsoptional boolean field in the customer creation and update APIs.Key Changes:
send_email_receiptsfield toCreateCustomerParamsSchemaandUpdateCustomerParamsinpackage/src/sdk/customers/cusTypes.ts:165,189.infisical.jsonnextjs/sdk.ts:8(note: this appears to be a test/demo file with intentional localhost override)Issues Found:
nextjs/sdk.ts:8contains misspelled environment variable name that will cause runtime failureConfidence Score: 2/5
send_email_receiptsare clean and well-structured. However,nextjs/sdk.tscontains a typo in the environment variable name that will cause the SDK to fail at runtime. While this appears to be an example/test file, it should not be merged with broken code.Important Files Changed
send_email_receiptsoptional boolean field to CreateCustomerParamsSchema and UpdateCustomerParams, reformatted indentation from spaces to tabsSequence Diagram
sequenceDiagram participant Client as SDK Client participant SDK as Autumn SDK participant API as Autumn API participant Email as Email Service Client->>SDK: customers.create({id, name, email, send_email_receipts}) SDK->>SDK: Validate params with CreateCustomerParamsSchema SDK->>API: POST /customers API->>API: Create customer record alt send_email_receipts is true API->>Email: Queue email receipt Email-->>API: Queued end API-->>SDK: Return Customer object SDK-->>Client: Return Customer object(2/5) Greptile learns from your feedback when you react with thumbs up/down!