fix: adds setNonce to TFormbricks type and jsdoc comments#29
fix: adds setNonce to TFormbricks type and jsdoc comments#29pandeymangg merged 7 commits intomainfrom
Conversation
WalkthroughAdds multiple public async methods to the Pre-merge checks❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/js/src/types/formbricks.ts(1 hunks)
🔇 Additional comments (4)
packages/js/src/types/formbricks.ts (4)
10-17: LGTM!The JSDoc documentation for the
setupmethod is clear and properly formatted.
19-36: LGTM!The JSDoc documentation for
setEmail,setAttribute, andsetAttributesmethods is clear and follows a consistent pattern.
56-66: LGTM!The JSDoc documentation and type signature for the
trackmethod are clear and properly defined.
68-77: LGTM!The JSDoc documentation for
logoutandregisterRouteChangeis clear and functional. The documentation style is appropriate for these action-oriented methods.
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
packages/js/src/types/formbricks.ts(1 hunks)
🔇 Additional comments (1)
packages/js/src/types/formbricks.ts (1)
50-55:setNoncereturn type asPromise<void>matches the proxy behavior (good)
This resolves the prior type mismatch risk (syncvoidvs async proxy). Only nit: align JSDoc style with the rest (@description, punctuation, andundefinedformatting).
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
apps/playground/package.json(1 hunks)packages/js/package.json(1 hunks)packages/js/src/types/formbricks.ts(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Build JS Package
apps/playground/package.json
[error] 1-1: Cannot install with 'frozen-lockfile' because pnpm-lock.yaml is not up to date with this package.json. Command failed: pnpm install --frozen-lockfile.
🪛 GitHub Actions: Run unit tests for js package
apps/playground/package.json
[error] 1-1: Dependency specifiers in lockfile do not match manifest. 4 mismatches: lucide-react (lockfile: 0.559.0, manifest: 0.561.0), next (16.0.8 vs 16.0.10), react (19.2.1 vs 19.2.3), react-dom (19.2.1 vs 19.2.3).
🪛 GitHub Actions: SonarQube
apps/playground/package.json
[error] 1-1: Command failed: pnpm install --frozen-lockfile. Lockfile is out of date and contains mismatched specifiers with the manifest: lucide-react (lockfile: 0.559.0, manifest: 0.561.0), next (lockfile: 16.0.8, manifest: 16.0.10), react (lockfile: 19.2.1, manifest: 19.2.3), react-dom (lockfile: 19.2.1, manifest: 19.2.3). Run 'pnpm install' or update the lockfile.
🔇 Additional comments (3)
packages/js/package.json (1)
4-4: LGTM! Version bump aligns with the new public API.The minor version increment from 4.2.1 to 4.3.0 appropriately reflects the addition of new public methods to the TFormbricks interface.
packages/js/src/types/formbricks.ts (2)
10-48: LGTM! JSDoc documentation is clear and consistent.The method signatures and documentation for
setup,setEmail,setAttribute,setAttributes,setLanguage, andsetUserIdfollow a consistent pattern with clear descriptions and parameter documentation.
56-76: LGTM! Event tracking and lifecycle methods are properly typed.The
track,logout, andregisterRouteChangemethods all correctly returnPromise<void>and have appropriate JSDoc documentation.
|
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (3)
packages/js/src/types/formbricks.ts (3)
10-17: Clarify whatsetupConfig.appUrlshould be (origin vs path) and how it relates toinitConfig.apiHost.
This remains easy to misconfigure when migrating frominit. Add an explicit example (and whether it must include protocol/port).
19-42: Tighten repetitive JSDoc phrasing (“of the user”) for consistency/readability.
Pure doc polish, but it’s repeated across the new public surface.
56-66:tracktyping still forcesproperties.hiddenFieldswheneverpropertiesis passed.
This preventstrack("x", {})and similar calls; consider makinghiddenFieldsoptional and/or allowing additional keys.track: ( code: string, properties?: { - hiddenFields: Record<string | number, string | number | string[]>; + hiddenFields?: Record<string | number, string | number | string[]>; } ) => Promise<void>;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
packages/js/src/types/formbricks.ts(1 hunks)
🔇 Additional comments (1)
packages/js/src/types/formbricks.ts (1)
44-48:setUserIdJSDoc looks good now.
Concise and consistent with the rest of the interface.



Adds the type for
setNonce