Skip to main content

Browser SDK

Browser SDK is a small script, window.sdk, that runs in the visitor's browser on PWA pages and on your prelandings. Through it the page offers to install the app, subscribes the visitor to push, and sends events to Qubix analytics.

It is a separate thing from the Server SDK — the set of server-side commands (sql, fetch, state) that run in scripts, Britva auto-rules, and the site backend. The Server SDK runs on the Qubix server, while the Browser SDK runs right on the visitor's page. Two different tools: the Browser SDK is in the browser, the Server SDK is on the server.

What it can do

  • Install the PWA — show the visitor the app install prompt and open an already installed app. See the Browser SDK reference.
  • Subscribe to push — request notification permission and create a subscription so the visitor can later receive push campaigns.
  • Events — report to analytics what happened on the page (a view, a push consent, an install), and send your own events.
  • Traffic parameters — read the offer, the PWA, the visitor id, and the tracker tags that came with the click.

Where it is connected

  • Automatically — on pages served by Qubix (the PWA store card, app pages). Nothing extra to do.
  • Manually — on your prelanding uploaded in Websites. This lets you install and subscribe visitors right on your own page, without sending them to the store card. How to do it — see SDK on your prelanding.
note

App install and push work only over a secure connection (HTTPS) and on a domain that is set up in Qubix and active. More on this in the article about connecting on a prelanding.

What's next