Guides
Task-oriented walkthroughs for the jobs an integration does most, with requests, responses and the errors that matter.
Each guide takes one task from start to finish: what you need, the requests in order, what comes back and
which errors to expect. The samples use the environment variables BATTERYPASS_URL and
BATTERYPASS_API_KEY from the Quickstart.
Public passports
Verify a signature offline
Canonicalise the public document, compare the hash and check the Ed25519 signature with the published key.
Resolve a QR code
From a scanned GS1 Digital Link to the public passport JSON, or look it up by GTIN and serial number.
Reading data
Sync units
Copy units into your system with cursor paging, resume after an interruption and spot changes.
Export passports
BatteryPass JSON, PDF and QR code of a passport version, and the units as a spreadsheet.
Reporting data
Push condition data
Send measurements from a battery management system with updateCondition.
Record lifecycle events
Report inspections, repairs and other events of a unit, and read its lifecycle.
Running in production
Handle errors and retries
Which answers to retry, backoff with jitter, and what to log.
Handle keys securely
Where keys live, which scope each system gets, rotation without downtime and what to do after a leak.
Looking for a script to copy? The Recipes are short, runnable programs for common jobs.