QR codes in deployment: Automatically switch targets after a release
Printed codes and new addresses
During a release, pages move: /sommerkarte becomes /karte, /produkt-a becomes /produkte/a. On the website, you handle this with redirects. However, printed QR codes continue to point to the old address, and redirect chains become longer with each release. With dynamic codes from Same-QR, you instead switch the target directly to the new address.
Step 1: Assignment in the repository
Keep track of which code should point where, for example in qr-ziele.csv next to your code. You retrieve the identifiers once with “sameqr qr list”:
speisekarte-lx3k9a1b2;https://example.com/karte
flyer-herbst-q8w7e6r5;https://example.com/aktion/herbstStep 2: Key for the pipeline
In the dashboard under Account, set up a dedicated "full" key under "Access for CLI, scripts and agents" specifically for deployment, as target changes require this level with appropriate runtime. Store it as the secret variable SAMEQR_API_KEY in your CI. The CLI reads it from there without saving it.
Step 3: Switching after the release
After a successful deployment, a short step runs:
npm install -g sameqr
while IFS=";" read -r id url; do
curl -fsS -o /dev/null "$url" || { echo "Ziel nicht erreichbar: $url"; exit 1; }
sameqr qr update "$id" --url "$url" --yes --json || exit 1
done < qr-ziele.csvThe script first checks whether the new address responds, and only then makes the change. In case of an error, it aborts. Because no one is at the terminal in the CI, --yes confirms the change. The CLI reads the current status of each code beforehand. Important: Through the API, there are a maximum of 10 target changes per hour and 30 per day. Thus, this step is suitable for a handful of codes per release. For larger changes, use the dashboard or time control.
Time control as an alternative
If the timing is known in advance, such as a launch on Monday at 9 a.m., the Pro plan offers time control: A code redirects from a date or at specific times to a different target, in the code's time zone, with up to 10 rules. Then no step in the deployment is needed.
Back if something goes wrong
Keep the old mapping. A rollback is then the same step with the previous file. Additionally, Same-QR checks all targets every night and sends an email if one is unreachable.
Conclusion: why Same-QR
With Same-QR, printed codes become part of your deployment: a CLI that fits into any pipeline, protection against parallel overwriting, time control from the Pro plan, and nightly target checks as a safety net. No link leads to a dead end after a release.
Get started right away: sign up for free at sameqr.com, two dynamic QR codes are free forever. API, CLI and MCP server are included in every plan, and the documentation is at sameqr.com/entwickler.
Frequently asked questions
In the secret variables of your CI as SAMEQR_API_KEY, never in the repository.
The codes redirected so far point to the new addresses, the rest to the old ones. With the same file, the step can be easily repeated.
In the free plan, the number of target changes per code is limited, in the paid plans it is not.
Reserve your spot before we go live.
One email as soon as the tool goes live — including pricing and the free plan. No spam, unsubscribe any time.
- Your free account is reserved — there is nothing to pay yet anyway
- 90 days of unlimited destination changes instead of 30, only for early sign-ups
- Launch price locked in, even if we raise prices later
By subscribing you consent to receiving the newsletter. You can withdraw consent at any time via the unsubscribe link in every email.