Skip to content

Add quickstart chat app interactive tutorial - send and receive message in less than 5 mins#685

Open
jhaaaa wants to merge 29 commits intomainfrom
int-quickstart
Open

Add quickstart chat app interactive tutorial - send and receive message in less than 5 mins#685
jhaaaa wants to merge 29 commits intomainfrom
int-quickstart

Conversation

@jhaaaa
Copy link
Collaborator

@jhaaaa jhaaaa commented Feb 20, 2026

@jhaaaa jhaaaa requested a review from a team as a code owner February 20, 2026 03:24
@vercel
Copy link

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
docs-xmtp-org Ready Ready Preview, Comment Mar 4, 2026 9:06pm

Request Review

@macroscopeapp
Copy link

macroscopeapp bot commented Feb 20, 2026

Add quickstart tutorial to send and receive XMTP messages in 5 minutes

  • Adds /chat-apps/quickstart tutorial page with step-by-step code snippets and a hello-world agent example that replies with 'gm'
  • Embeds a live XMTP inbox in the docs sidebar that creates a DM with a demo app on the dev environment and streams messages
  • Generates ephemeral EOA identities for the app and inbox on page load and interpolates them into code snippets
  • Risk: sets server.fs.strict to false in vocs.config.tsx to accommodate WASM dependency loading

Changes since #685 opened

  • Removed CLI/Browser tab selection from QuickstartStep component, hardcoding display to always render browser implementation code [0c847c2]
  • Added stale flag to Shiki syntax highlighting effect in QuickstartStep component to prevent state updates after unmount [0c847c2]
  • Added explicit nulling of DM-related refs in cleanup function of QuickstartInbox component initialization useEffect hook [0c847c2]
  • Replaced inline code fences with <CopyableCode> components using STATIC_CODE.viteConfig and STATIC_CODE.indexHtml for the vite.config.js and index.html snippets, and added label prop to multiple <QuickstartStep> instances in the /chat-apps/quickstart documentation page [80c7c56]
  • Added STATIC_CODE constant export containing viteConfig and indexHtml static code snippets, extended QuickstartStep and CopyableCode components to accept optional label prop, removed inline justifyContent: 'flex-end' styling from headers, and added .qs-label CSS class for label rendering [80c7c56]
  • Corrected state setter name from setCopiedKey to setCopiedAddr for the copiedAddr boolean state in the QuickstartInbox component [80c7c56]
  • Removed the agents/hello-world example application and all associated configuration files [1f73eb4]
  • Updated component documentation comment in QuickstartSteps.tsx [1f73eb4]
  • Added call to clear main HTML content in QuickstartStep component's React.useEffect hook before performing Shiki syntax highlighting [7deb2ee]
  • Updated navigation links and routing configuration to point to /chat-apps/intro/quickstart [0a02ed7]
  • Corrected the QuickstartSteps component import path [0a02ed7]
  • Added quickstart tutorial references to documentation pages [0a02ed7]
  • Clarified messaging interoperability and variable roles in the quickstart tutorial [894fa27]
  • Added example output for Inbox ID connection [894fa27]
  • Refined message sending instructions and restructured navigation [894fa27]

Macroscope summarized 916eb01.

@jhaaaa jhaaaa changed the title Add interactive tutorial - send and receive message in less than 5 mins Add quickstart chat app interactive tutorial - send and receive message in less than 5 mins Feb 26, 2026
Then replace the contents of `<body>` in your `index.html` with:

```html
<input id="message" type="text" placeholder="Type a message..." />

Choose a reason for hiding this comment

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

Since vite includes a default style.css in their demo, maybe there's a way to class up the demo and hijack their existing theming.

import { keccak_256 } from "@noble/hashes/sha3.js";

// Private key and address from the docs page widget (ephemeral — dev only)
const privateKey = new Uint8Array([${bytes}]);

Choose a reason for hiding this comment

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

It might be too early for this but we could use Uint8Array.fromHex(${hextString}) for the private key instead to make this look a little less overwhelming. It's a new method (Sept 2025) but it's well adopted


// Private key and address from the docs page widget (ephemeral — dev only)
const privateKey = new Uint8Array([${bytes}]);
const address = "${identity.address}";

Choose a reason for hiding this comment

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

I think we need address and otherAddress here. I'm address on my quickstarted copy of the code and I'm chatting with otherAddress on the quickstart guide page, in the sidebar.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, @mproberts - I thought we wanted this to be a self-DM setup? =) The address and inbox ID are the same for the quickstart app and the live inbox in the docs. Am I understanding your feedback correctly? TY!

Choose a reason for hiding this comment

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

Yup, I think this is where we got wires crossed. When I said "self" I meant you are in control of both but it's two separate intances so we're not reusing keys, we're chatting between two "inboxes" you just are controlling both. ie. you have inbox A = docs message box, inbox B = your new app/web/android/ios, inbox A messages inbox B so there's a Me and a You in the chat.

)}
<div style={{ marginTop: '0.375rem' }}>
<button className="qi-copy-btn" onClick={handleCopyKey}>
{copiedKey ? 'Copied!' : 'Copy private key'}

Choose a reason for hiding this comment

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

Likewise, this should be "Copy InboxID" as this is the inbox ID of the other participant. If this changes, ie. a page refresh, we'd copy paste over the otherInboxId hex string in our local version of the code

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