Add canonical examples for the marketing SDK pages - #509
Merged
Merged
Conversation
Jonesy464
force-pushed
the
rj/3646-canonical-examples
branch
from
August 20, 2026 23:08
1b412d2 to
6073b70
Compare
Jonesy464
marked this pull request as ready for review
August 26, 2026 21:32
fostimus
approved these changes
Aug 27, 2026
Interactive signing is a common ask and the flag that enables it was not visible in the example. Set to false with a comment on what true does, per review on #509.
Matches the marketing page key, which moved off create-etch-packet for search intent (review on anvilco/marketing-site#3674). The concept is derived from the filename, so the two have to agree.
Matches the marketing page key, which stays at its published /sign/ URL rather than renaming (review on anvilco/marketing-site#3674). The concept is derived from the filename, so the two have to agree.
The marketing site renders these verbatim in a panel about 79 characters wide, so longer lines scroll sideways. generate-markdown's content was one 252-character line; split across literals it is the same 230 characters. fill now builds a payload variable first, matching the C# and Python examples. The sign run instructions still named create-etch-packet, which the rename to sign.* left behind.
Jonesy464
force-pushed
the
rj/3646-canonical-examples
branch
from
September 3, 2026 21:42
be10edd to
df470ca
Compare
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.
Part of anvilco/marketing-site#3646 (SDK repos own their code examples; the central anvil-api-usage-examples repo is being sunset).
Adds
examples/{fill,generate-markdown,generate-html,create-etch-packet}.{js,ts}: the canonical, display-ready examples the marketing SDK pages will source at build (the sourcing shipped with anvilco/marketing-site#3617 scans exactly this directory; the kebab-cased basename becomes the example concept, and the file extension routes it to the JavaScript or TypeScript page).Content is migrated from anvil-api-usage-examples with a refresh pass. Fixes found in the sources:
baseURL: 'https://staging.useanvil.com', pointing anyone who copied it at staging. Removed.static/asset that only exists in the central repo; the example is now the self-contained sample-template flow (upload-with-fields stays documented in the API docs).placekitten.comimage URL is a dead service. Dropped.font-style: underlinein the HTML example is invalid CSS; nowitalic.../lib/runharness with plain async entrypoints, and trimmed headers. The run commands are framed for a consumer project since@anvilco/anvilcan't self-resolve inside this repo (noexportsfield).Verification:
@anvilco/anvilunder bothmoduleResolution: bundlerandnode/CommonJS; JS mirrors pass Node ESM syntax checks.isTestdraft so no email was sent; the committed file keepsisDraft: false).deriveLanguageExamplesresolves this directory to exactly the four concepts per language.