Repository navigation
docs: add JavaScript SDK quickstart and publish snippets - #534
Closed
techwritermat wants to merge 1 commit into
Closed
techwritermat wants to merge 1 commit into
techwritermat wants to merge 1 commit into
Conversation
Adds the snippets behind the new JavaScript SDK docs IA. New files in docs-snippets/: - quickstart-web.ts, quickstart-web.html - quickstart-node.ts, quickstart-node.mjs - quickstart-react.tsx, quickstart-react-app.tsx - quickstart-commands.sh Extended files: - basic-usage/configuration.ts: setUserId, getUserId, getAuthKey, destroy - publish-subscribe.ts: publishMinimal, publishHandleErrors, publishFalsyMessage Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
techwritermat
requested review from
jguz-pubnub,
mohitpubnub and
parfeon
as code owners
October 29, 2026 11:11
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the docs snippets behind the new JavaScript SDK docs IA (proof of concept on the documentation repo, branch sdk-ia-poc). The docs pages currently hard code these snippets and will switch back to EmbeddedCode URLs on master once this merges.
New files in
docs-snippets/:quickstart-web.tsandquickstart-web.html: snippet idsquickstartWebInit,quickstartWebListeners,quickstartWebSubscribe,quickstartWebPublish, plus the complete page.quickstart-node.tsandquickstart-node.mjs: snippet idsquickstartNodeListeners,quickstartNodePublish, plus the complete module.quickstart-react.tsxandquickstart-react-app.tsx: snippet idsquickstartReactImports,quickstartReactInit,quickstartReactSubscribe,quickstartReactPublish, plus the completeApp.tsx. The subscribe snippet unsubscribes in the effect cleanup so React StrictMode does not subscribe twice.quickstart-commands.sh: shell commands for the quickstarts (not meant to be run as a script).Extended files:
basic-usage/configuration.ts:setUserIdBasicUsage,getUserIdBasicUsage,getAuthKeyBasicUsage,destroyBasicUsage.publish-subscribe.ts:publishMinimal,publishHandleErrors,publishFalsyMessage.Verification:
npm run test:snippets(tsc -p docs-snippets/tsconfig.json --noEmit) passes. It only includes.tsfiles, so it does not cover the two.tsxfiles.demokeyset: the config and publish snippets, the Node quickstart (connects, publishes, receives its own message), and the Web quickstart page in jsdom (connects, publishes, message appears in the list).publishHandleErrorsalso printsMissing 'message'on a validation failure..tsxfiles withstrictagainstpubnub13.1.3 and React 19.3.1, and ran the React app in jsdom under StrictMode: the message appears once with the cleanup and twice without it.Docs only, no changes to
src/orlib/.🤖 Generated with Claude Code