Skip to content

docs(tutorials): split setupDashClient into browser-safe core and Node wrapper#144

Merged
thephez merged 2 commits intodashpay:3.1.0from
thephez:refactor-sdk-setup
Apr 22, 2026
Merged

docs(tutorials): split setupDashClient into browser-safe core and Node wrapper#144
thephez merged 2 commits intodashpay:3.1.0from
thephez:refactor-sdk-setup

Conversation

@thephez
Copy link
Copy Markdown
Collaborator

@thephez thephez commented Apr 21, 2026

Mirror the upstream platform-tutorials refactor that separates setupDashClient.mjs into setupDashClient-core.mjs (browser-safe) and a thin Node wrapper, and register the new core file in the tutorial sync map.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Preview build: https://dash-docs-platform--144.org.readthedocs.build/en/144/

Summary by CodeRabbit

  • Documentation
    • Updated the SDK client setup tutorial to show a two-module architecture that cleanly separates browser-safe core code from Node.js-specific setup for clearer guidance.
    • Added tutorial code mapping so code samples are linked and captioned appropriately for easier navigation and reference.

…e wrapper

Mirror the upstream platform-tutorials refactor that separates setupDashClient.mjs into setupDashClient-core.mjs (browser-safe) and a thin Node wrapper, and register the new core file in the tutorial sync map.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aff2fcfe-97c3-4042-9874-2dd953ba44e8

📥 Commits

Reviewing files that changed from the base of the PR and between e9daefa and 43d89ee.

📒 Files selected for processing (1)
  • docs/tutorials/setup-sdk-client.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/tutorials/setup-sdk-client.md

📝 Walkthrough

Walkthrough

The tutorial splits one setup module into two: setupDashClient-core.mjs (runtime-agnostic, browser-safe) and a Node-only setupDashClient.mjs wrapper. Export surface is reorganized (KEY_SPECS exported; key managers exported); dotenv loading removed from core; hex decoding uses a browser-safe hexToBytes(). Mapping file updated.

Changes

Cohort / File(s) Summary
Tutorial Documentation
docs/tutorials/setup-sdk-client.md
Updated examples and text to show two modules: setupDashClient-core.mjs (exports createClient, dip13KeyPath, KEY_SPECS, IdentityKeyManager, AddressKeyManager; removes dotenv; replaces Buffer.from(...,'hex') with hexToBytes()), and a Node-only setupDashClient.mjs wrapper that loads dotenv, defines clientConfig/setupDashClient(), and re-exports core exports.
Tutorial Mapping Configuration
scripts/tutorial-sync/tutorial-code-map.yml
Added mapping entry linking the new setupDashClient-core.mjs code sample to docs/tutorials/setup-sdk-client.md.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I split my module, neat and spry,
Core for browsers, Node says hi,
Hex to bytes, no buffers near,
Exports tidy, everything clear,
Hoppity hops—code ready to fly! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: splitting setupDashClient into a browser-safe core module and a Node wrapper, which matches the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thephez thephez marked this pull request as ready for review April 22, 2026 16:38
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/tutorials/setup-sdk-client.md`:
- Around line 106-119: In the hexToBytes function, replace the deprecated
String.prototype.substr usage with slice to preserve behavior: change the
hex.substr(i * 2, 2) call in hexToBytes to hex.slice(i * 2, i * 2 + 2) so you
still extract two characters per iteration and keep the existing parseInt and
Number.isNaN checks unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b55f7231-d555-4b9d-82f5-87791a8803a6

📥 Commits

Reviewing files that changed from the base of the PR and between a284662 and e9daefa.

📒 Files selected for processing (2)
  • docs/tutorials/setup-sdk-client.md
  • scripts/tutorial-sync/tutorial-code-map.yml

Comment thread docs/tutorials/setup-sdk-client.md
@thephez thephez merged commit 79a84e8 into dashpay:3.1.0 Apr 22, 2026
2 checks passed
@thephez thephez deleted the refactor-sdk-setup branch April 22, 2026 20:03
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.

1 participant