Skip to content

Conversation

@john-autumn
Copy link

@john-autumn john-autumn commented Jan 27, 2026


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

    • Added send_email_receipts?: boolean to CreateCustomerParams (zod) and UpdateCustomerParams.
    • Optional field; omitting it preserves current behavior.
  • Bug Fixes

    • Corrected AUTUMN_SECRET_KEY env var in the Next.js example.

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_receipts optional boolean field in the customer creation and update APIs.

Key Changes:

  • API changes: Added send_email_receipts field to CreateCustomerParamsSchema and UpdateCustomerParams in package/src/sdk/customers/cusTypes.ts:165,189
  • Improvements: Added Infisical configuration for secrets management in .infisical.json
  • Bug fixes: Fixed typo in example code's environment variable name in nextjs/sdk.ts:8 (note: this appears to be a test/demo file with intentional localhost override)

Issues Found:

  • Critical syntax error: nextjs/sdk.ts:8 contains misspelled environment variable name that will cause runtime failure

Confidence Score: 2/5

  • This PR has a critical runtime error in the example SDK file that must be fixed before merging
  • The core type changes for adding send_email_receipts are clean and well-structured. However, nextjs/sdk.ts contains 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.
  • nextjs/sdk.ts requires immediate attention to fix the environment variable typo before this PR can be merged

Important Files Changed

Filename Overview
nextjs/sdk.ts Updated example SDK code with typo in env var, changed from useCustomer hook to customers.create API call, added localhost URL override
package/src/sdk/customers/cusTypes.ts Added send_email_receipts optional boolean field to CreateCustomerParamsSchema and UpdateCustomerParams, reformatted indentation from spaces to tabs
.infisical.json Added Infisical configuration file for secrets management with workspace ID

Sequence 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
Loading

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
autumn-ui Error Error Jan 28, 2026 9:43am

Request Review

Copy link

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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 secretKey in nextjs/sdk.ts means the SDK will see undefined, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants