📝 docs: improvements - #1049
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a Resources documentation page with Exa server IPs and Rain RSA public keys, updates SIWE authentication examples to use environment-driven API_BASE_URL and INTEGRATOR_ADMIN_PRIVATE_KEY and adds invite/accept example snippets, and wires the Resources page into the docs sidebar with a changeset. ChangesConfiguration Resources Documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new "Resources" documentation page listing Exa server IPs and Rain RSA public keys, updates the Astro sidebar configuration, and expands the organization authentication guide with detailed guides and code snippets for sending and accepting invitations. The review feedback suggests utilizing the validated API_BASE_URL variable directly in the authentication client setup to avoid redundant environment variable access, and changing the code block language specifier for PEM public keys from bash to text to prevent incorrect syntax highlighting.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1049 +/- ##
==========================================
+ Coverage 74.70% 74.73% +0.03%
==========================================
Files 243 243
Lines 11448 11460 +12
Branches 3932 3945 +13
==========================================
+ Hits 8552 8565 +13
Misses 2575 2575
+ Partials 321 320 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🦋 Changeset detectedLatest commit: ce3b598 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b00da9b to
bd438df
Compare
3db699e to
c817b61
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 00896bb9-28aa-4ec7-ac99-9c5a076af9d4
📒 Files selected for processing (4)
.changeset/cute-buttons-roll.mddocs/astro.config.tsdocs/src/content/docs/organization-authentication.mddocs/src/content/docs/resources.md
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 924dfeba26
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/src/content/docs/organization-authentication.md (1)
383-383:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMissing validation for
INTEGRATOR_ADMIN_PRIVATE_KEYin both invite sections.Both the "send an Invite" (line 383) and "accept an invite" (line 462) examples use
process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hexwithout validation. If the environment variable is undefined,privateKeyToAccountwill throw a runtime error in both flows.🛡️ Recommended fix pattern for both sections
+const INTEGRATOR_ADMIN_PRIVATE_KEY = process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hex | undefined; +if (!INTEGRATOR_ADMIN_PRIVATE_KEY) throw new Error("INTEGRATOR_ADMIN_PRIVATE_KEY environment variable is required"); + -const owner = privateKeyToAccount(process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hex); +const owner = privateKeyToAccount(INTEGRATOR_ADMIN_PRIVATE_KEY);
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2192bf34-839c-4946-8b82-4eabe3308df9
📒 Files selected for processing (4)
.changeset/cute-buttons-roll.mddocs/astro.config.tsdocs/src/content/docs/organization-authentication.mddocs/src/content/docs/resources.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/astro.config.ts (1)
19-19:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd trailing comma after "webhooks".
The items array is missing a trailing comma after the last element. As per coding guidelines, all structures (objects, arrays, function arguments) in TypeScript files should use trailing commas to maintain diff-friendliness.
📝 Proposed fix
- { label: "Docs", items: ["index", "organization-authentication", "resources", "webhooks"] }, + { label: "Docs", items: ["index", "organization-authentication", "resources", "webhooks",] },Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 072d1d29-ddbb-4639-894b-b7dfabbca21f
📒 Files selected for processing (3)
.changeset/cute-buttons-roll.mddocs/astro.config.tsdocs/src/content/docs/resources.md
70b654d to
1898faa
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (4)
docs/src/content/docs/organization-authentication.md (4)
383-383:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winValidate
INTEGRATOR_ADMIN_PRIVATE_KEYbefore use.The code asserts
process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hexwithout checking if it is defined. If undefined,privateKeyToAccountwill fail at runtime.
462-462:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winValidate
INTEGRATOR_ADMIN_PRIVATE_KEYbefore use.The code asserts
process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hexwithout checking if it is defined. If undefined,privateKeyToAccountwill fail at runtime.
101-101:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winValidate
INTEGRATOR_ADMIN_PRIVATE_KEYbefore use.The code asserts
process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hexwithout checking if it is defined. If undefined,privateKeyToAccountwill fail at runtime.🛡️ Proposed fix
+const INTEGRATOR_ADMIN_PRIVATE_KEY = process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hex | undefined; +if (!INTEGRATOR_ADMIN_PRIVATE_KEY) throw new Error("INTEGRATOR_ADMIN_PRIVATE_KEY environment variable is required"); + -const owner = privateKeyToAccount(process.env.INTEGRATOR_ADMIN_PRIVATE_KEY as Hex); +const owner = privateKeyToAccount(INTEGRATOR_ADMIN_PRIVATE_KEY);
364-403: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoffAlign the invite section with the "Creating an organization" pattern: use environment-driven domain and chain.
The "Creating an organization" section (lines 85–155) derives
domainfromAPI_BASE_URLand usesbaseSepoliachain. This invite section hardcodesdomain = "sandbox.exactly.app"and usesoptimismSepolia(line 369), creating an inconsistency. For production-ready examples, adopt the same environment-driven approach and chain selection used earlier.♻️ Proposed pattern
-const chainId = optimismSepolia.id; - -const domain = "sandbox.exactly.app"; +const API_BASE_URL = process.env.API_BASE_URL; +if (!API_BASE_URL) throw new Error("API_BASE_URL environment variable is required"); +const domain = new URL(API_BASE_URL).hostname; -const authClient = createAuthClient({ - baseURL: `https://${domain}`, +import { baseSepolia } from "viem/chains"; +const chainId = baseSepolia.id; + +const authClient = createAuthClient({ + baseURL: API_BASE_URL, plugins: [siweClient(), organizationClient()], });Also apply the same change to the "How to accept an invite" section (line 440–518, currently using
optimismSepoliaand hardcoded domain at lines 455–456).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9d90f30f-5932-4b8b-b67e-4bbcc8e115c7
📒 Files selected for processing (4)
.changeset/cute-buttons-roll.mddocs/astro.config.tsdocs/src/content/docs/organization-authentication.mddocs/src/content/docs/resources.md
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/src/content/docs/organization-authentication.md (1)
108-121:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winGuard the nonce result before signing.
nonceResult?.nonce ?? ""can still produce an invalid SIWE message if the nonce lookup fails. The invite/accept snippets already guard this path; this section should match that pattern.
♻️ Duplicate comments (3)
docs/src/content/docs/organization-authentication.md (2)
101-101:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winValidate
INTEGRATOR_ADMIN_PRIVATE_KEYbeforeprivateKeyToAccount.The unchecked cast still lets a missing env var reach the account constructor and fail at runtime.
374-403:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winDerive the SIWE domain from
API_BASE_URLin both invite flows.Both snippets still hardcode
sandbox.exactly.app, so the examples diverge from the environment-driven setup above and won't stay correct outside sandbox.Also applies to: 455-482
docs/astro.config.ts (1)
19-19:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRestore the trailing comma after
webhooks.The
Docssidebar array still violates the repo's trailing-comma rule. As per coding guidelines, use trailing commas in TypeScript arrays.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ca56bc31-ad02-40dc-ac85-8efa02109039
📒 Files selected for processing (4)
.changeset/cute-buttons-roll.mddocs/astro.config.tsdocs/src/content/docs/organization-authentication.mddocs/src/content/docs/resources.md
Summary by CodeRabbit
Documentation
Chores
Style/Navigation