Automate Flipbook Publishing in CI/CD with the FlipLink CLI

Automate flipbook publishing in any CI/CD pipeline with the FlipLink CLI — create, publish, capture the URL, and fail fast on exit codes.

Sumit Ghugharwal
Sumit Ghugharwal

Published on June 21, 2026 · 6 min read

Share this post:

If a PDF lives in your repo — a release notes deck, a product catalog, a quarterly report — then publishing the flipbook version of it should be part of the same build that produces the PDF. No dashboard, no manual upload, no "did someone remember to update the flipbook?" The FlipLink CLI is built for exactly this: it runs headless, authenticates from an environment variable, and returns clean exit codes a pipeline can branch on.

This guide shows a minimal, platform-neutral CI/CD pipeline that builds a PDF, creates the flipbook, publishes it, and captures the live URL.

Why Run Publishing in CI

The dashboard is great for one-off uploads. A pipeline is better when the work is repeatable:

  • Repeatable and auditable — the same steps run every time, logged in your CI history.
  • No dashboard, no human step — nobody has to remember to upload after a release.
  • Single source of truth — the PDF in the repo is what ships, so the flipbook never drifts from the document.
  • Fail loud — if a publish breaks, the build goes red instead of silently shipping a stale flipbook.

This is automation in the plainest sense: the CLI is the same engine as the API, so anything you can do by hand you can script.

Step 1: Store the API Key as a CI Secret

The CLI reads your key from the FLIPLINK_API_KEY environment variable in CI (its resolution order is env var → config file → default). Get a key by signing in at go.fliplink.me and opening the Subscription page.

Add it as a secret in your CI provider — never commit it, never echo it into logs. Then expose it to the job as an environment variable:

# Provided by your CI's secret store, not hard-coded
export FLIPLINK_API_KEY="$CI_SECRET_FLIPLINK_API_KEY"

A quick sanity check that auth works before doing real work:

fliplink whoami

If the key is missing or wrong, this exits non-zero and your pipeline stops early — exactly what you want.

Step 2: A Minimal Pipeline

Here is a generic, platform-neutral pipeline (pseudo-YAML — map the keys onto whatever CI you use). For a release-triggered GitHub Actions version specifically, see the GitHub Actions on release walkthrough.

pipeline:
  publish-flipbook:
    image: node:20
    secrets:
      - FLIPLINK_API_KEY        # injected from the CI secret store
    steps:
      - name: Install the CLI
        run: npm install -g fliplink-cli

      - name: Build the PDF
        run: ./scripts/build-report.sh   # your build that emits ./dist/report.pdf

      - name: Verify auth
        run: fliplink whoami

      - name: Create the flipbook
        run: |
          ID=$(fliplink flipbook create ./dist/report.pdf \
                 --title "Quarterly Report" --name quarterly \
                 --json | jq -r '.ID')
          echo "FLIPBOOK_ID=$ID" >> "$PIPELINE_ENV"

      - name: Publish the flipbook
        run: fliplink flipbook publish "$FLIPBOOK_ID"

      - name: Capture the share URL
        run: |
          URL=$(fliplink flipbook share-link "$FLIPBOOK_ID" \
                  --json | jq -r '.URL')
          echo "Published: $URL"

The flow is four real commands: build the PDF, fliplink flipbook create, fliplink flipbook publish, then fliplink flipbook share-link. Everything else is plumbing your CI provides.

Step 3: Capture the Flipbook ID and URL

The key trick is --json. Any FlipLink CLI command accepts it and prints raw JSON, which you pipe to jq to pull out exactly the field you need:

# Create and grab the new flipbook's ID
ID=$(fliplink flipbook create ./dist/report.pdf \
       --title "Quarterly Report" --name quarterly \
       --json | jq -r '.ID')

# Publish it
fliplink flipbook publish "$ID"

# Grab the public share URL to post in Slack, an email, or a release note
URL=$(fliplink flipbook share-link "$ID" --json | jq -r '.URL')

Pass $ID between steps however your CI shares state — an output variable, an env file, or a written artifact. For more jq patterns — filtering lists, extracting nested fields, building tables — see scripting the CLI with jq.

🚀

Try FlipLink Free

Convert your PDF in seconds. No sign-up, no credit card — just upload and go.

Drop your PDF here or click to browse

Max 40MB

Paid plans from $39 raise this to 150 MB.

Step 4: Fail Fast on Exit Codes

A pipeline is only as good as its error handling. The CLI gives you three exit codes to branch on:

  • 0 — success
  • 1 — request or HTTP error (bad network, 401 auth failure, oversize upload)
  • 2 — application error (the API returned Result: ERROR, e.g. a validation problem)

Most CI runners stop a step automatically on any non-zero exit, which is usually what you want. If you need to react differently per code, branch explicitly:

set -euo pipefail

if fliplink flipbook publish "$ID" --json; then
  echo "Published OK"
else
  code=$?
  if [ "$code" -eq 2 ]; then
    echo "FlipLink rejected the request (application error)" >&2
  else
    echo "Request/HTTP error talking to FlipLink" >&2
  fi
  exit "$code"
fi

Note that the FlipLink API returns business errors as HTTP 200 with Result: ERROR in the body — the CLI already maps that to exit code 2 for you, so a clean exit-code check is enough. You do not have to parse status codes by hand.

Step 5: Notify on Success

Once you have the URL captured, the last step is just telling someone. The URL is a plain string, so any notifier works:

URL=$(fliplink flipbook share-link "$ID" --json | jq -r '.URL')

curl -X POST "$SLACK_WEBHOOK_URL" \
  -H 'Content-Type: application/json' \
  -d "{\"text\": \"New flipbook published: $URL\"}"

Swap the curl call for an email, a GitHub comment, or a write to your changelog — the pattern is the same. Because every step fails fast, this notification only fires when the publish genuinely succeeded.

Wrapping Up

That is the whole pattern: store the key as a secret, install the CLI, build the PDF, then createpublish → capture the URL with --json | jq, with exit codes guarding every step. It is small enough to drop into any pipeline and reliable enough to forget about — which is the point of automation and integrations.

New to the CLI? Start with getting started with the FlipLink CLI, then come back and wire it into your build.

Ready to Create Your First Flipbook?

Transform your PDFs into interactive flipbooks and documents. Get started with FlipLink's Lifetime Deal — lifetime access that starts at just $39.

#ci/cd#automation#cli#headless#publishing pipeline
Lifetime Deal

Pay Once, Use Forever

10, 50 or 100 flipbooks · All 35 features · Unlimited domains

$39
10 Flipbooks
$89
50 Flipbooks
Most Popular
$129
100 Flipbooks

No feature gates. Every Lifetime Deal tier unlocks all 35 features.

  • Every feature unlocked — no feature gates
  • Stackable — buy more codes anytime
  • Replaceable — swap old for new
  • Unlimited custom domains (CNAME)
  • No recurring fees, ever

Related Reading

Tutorials6 min read

Batch-Convert a Folder of PDFs to Flipbooks

Batch convert PDF to flipbook from a whole folder with one shell loop using the FlipLink CLI — capture URLs to CSV and skip bad files.

Sumit Ghugharwal