Add canonical examples for the marketing SDK pages - #509
Conversation
1b412d2 to
6073b70
Compare
| // Test packets use development signatures and do not count toward | ||
| // your billed packets | ||
| isTest: true, | ||
|
|
There was a problem hiding this comment.
can you add allowUpdates: false in here? it powers interactive signing, which a lot people want/will need. the comment can be about how you need it set to true to use interactive signing, and interactive signing is a product pack feature
There was a problem hiding this comment.
Added to both the .js and .ts examples:
// Set to true for interactive signing, where signers fill fields as they
// sign. Over the API that needs the Product pack or Enterprise plan
allowUpdates: false,Used "Product pack or Enterprise" since that's what the e-sign doc says for API access.
One catch: the Python and C# examples can't have this field. allowUpdates isn't on CreateEtchPacketPayload in python-anvil or Payloads/Request/CreateEtchPacket.cs in dotnet-anvil. node-anvil works because it passes variables straight through.
Those two SDKs are missing a lot more than this one. createEtchPacket takes 25 args, python-anvil is missing 9 and dotnet-anvil 12:
- python-anvil:
allowUpdates,requireSignatures,finishPageOptions,excludeCertificateFromSignerDownloads,signatureRecipients,signatureProvider,advancedCreate,detectBoxesAdvanced,organizationEid - dotnet-anvil: those plus
enableEmails,createCastTemplatesFromUploads,duplicateCasts
Should I create an issue to update them?
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.
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.