Add Spark Auth Tool (interactive cipher/signature simulator)#124
Open
anayse-sardinha wants to merge 6 commits into
Open
Add Spark Auth Tool (interactive cipher/signature simulator)#124anayse-sardinha wants to merge 6 commits into
anayse-sardinha wants to merge 6 commits into
Conversation
Embed the client-provided browser-based Spark auth simulator in the docs. The tool runs entirely client-side (Web Crypto API), encrypting/decrypting the StartAuthentication and StartSession ciphers and building the TransactionSignature / legacy Signature headers. - Host the self-contained tool at /tools/spark-auth-tool.html, with an embedded mode (hides its own header inside an iframe) and a ?auth=legacy deep-link that opens the Legacy Auth (v1) flow. - Embed it inline in the Authentication and Legacy Authentication pages. - Add an "Auth Tool" tile to the Terminal SDKs grid on the home page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mintlify production does not serve raw .html files, so the iframe embed 404'd in the deploy preview. Replace the iframe with a native React component that renders the tool's exact markup, CSS, and script inside a shadow root (style isolation), driven by the tool's own logic. - snippets/SparkAuthTool.jsx: generated component (verbatim port). - tools/generate-spark-auth-tool.mjs: regenerates the component from tools/spark-auth-tool.html; re-run when the client ships a new version. - Authentication / Legacy Authentication pages now import and render <SparkAuthTool /> (legacy variant opens on the Legacy Auth v1 tab). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mintlify's production bundler evaluates the exported component in isolation and drops non-exported module-level declarations, so the module-level CSS/BODY/SCRIPT consts were undefined at runtime (ReferenceError: BODY is not defined), and the component crashed and unmounted. Move the constants inside the component function so they travel with it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Per client request, surface the tool from the StartAuthentication and StartSession reference pages. - openapi/spark.yaml: add a "Try it: Spark Auth Tool" card to both operation descriptions. StartSession links with #startsession. - SparkAuthTool component: read a URL hash on mount so a link can open a specific tab (#startsession opens the StartSession tab). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
StartSession had the same text in both x-mint.content and the standard description field, so the reference page rendered it twice. Drop the redundant description; x-mint.content (text + Try it card) remains. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Adds the client-provided Spark Auth Tool to the DevZone: a browser-based interactive simulator that lets integrators encrypt/decrypt the auth ciphers and build the required HTTP header signatures without writing code. Goal is to cut friction and support overhead around Spark auth integration.
The tool is fully client-side (Web Crypto API, no backend); the only external dependency is Google Fonts.
What's included
tools/spark-auth-tool.html, served at/tools/spark-auth-tool.html. Two small local tweaks were added on top of the client's file:?auth=legacydeep-link — opens the tool directly on the Legacy Auth (v1) flow.snippets/IntegratePOS.jsx), linking to the Authentication page.docs.jsonis unchanged (the tool is surfaced via the embeds and the home tile, not a new nav entry).Verification
Verified locally with
mint dev: home, both auth pages, and the tool asset (incl.?auth=legacy) all return 200; embeds render; no build errors from these changes.Before publishing
?auth=legacydeep-link) must be re-applied.🤖 Generated with Claude Code