Skip to content

feat: template image variants, per-pass images and changeMessage - #8

Merged
alexpate merged 3 commits into
mainfrom
feat/image-variants
Oct 6, 2026
Merged

alexpate merged 3 commits into
mainfrom
feat/image-variants

Conversation

@alexpate

@alexpate alexpate commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

SDK support for the new pass image APIs:

  • templates.uploadImage / deleteImage (optional variant for strip/thumbnail/background), Template.image_variants
  • imageVariant on passes.create / passes.update (null clears), Pass.image_variant
  • passes.uploadImage / deleteImage for per-pass images, Pass.images (resolved source per slot)
  • TemplateField.changeMessage (the lock-screen notification text)
  • EventPass.image_variant

Base64 encoding avoids Buffer, so it works on Workers. README has stamp-card and member-photo examples. Minor changeset (→ 0.4.0).

Depends on the matching platform endpoints being deployed.

Templates can now hold named variants of the strip, thumbnail and
background images, and passes can opt into one. Lets a stamp card swap
its strip per stamp count without a template per state.

- templates.uploadImage(id, slot, data, { variant }) PUTs base64 image
  data; encoding uses btoa rather than Buffer so it works on Workers.
- templates.deleteImage(id, slot, { variant }) removes an image/variant.
- passes.create/update accept imageVariant (null on update clears it).
- Pass.image_variant, Template.image_variants, and exported
  TemplateImage / TemplateImageSlot / VariantImageSlot /
  TemplateImageOptions types.
The platform already accepts it and spreads it into pass.json; it's the
only thing that makes Apple show a lock-screen notification when a field
changes on update. Must contain %@ (replaced with the new value).
A pass can now carry its own strip, thumbnail or background image (e.g.
a member photo), layered over its template variant and base image.

- passes.uploadImage(id, slot, data) PUTs base64 image data (reusing the
  runtime-agnostic encoder) and passes.deleteImage(id, slot) removes the
  override; both return the updated Pass and send no Idempotency-Key.
- Pass.images reports each resolved slot's source (pass/variant/template);
  EventPass gains image_variant.
- Export PassImageSlot (alias of VariantImageSlot), PassImageSource and
  PassImages.
@alexpate
alexpate merged commit 3de93fc into main Oct 6, 2026
6 checks passed
@alexpate
alexpate deleted the feat/image-variants branch October 6, 2026 14:17
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.

1 participant