Connected Basic Integration
BETA
SDK Stats
Github Repository is Private until General Availability
SDK Size: 33kb
Speed: Median 80ms to 250ms
Minimum Requirements
The Branch Connected SDK requires native browser Javascript and has only been tested in Tizen and WebOS with sessionStorage capability. No 3rd party libraries are needed to make use of the SDK as is it 100% native Javascript.
OS Specific Support
Tizen | WebOS |
---|---|
2.3 | 6.0 |
Testing OS Support
Initialize Branch
Script
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<script>
// load Branch
(function (b, r, a, n, c, h, _, s, d, k) {
if (!b[n] || !b[n]._q) {
for (; s < _.length;) c(h, _[s++]);
d = r.createElement(a);
d.async = 1;
d.src = "https://cdn.branch.io/branch-connected.min.js";
k = r.getElementsByTagName(a)[0];
k.parentNode.insertBefore(d, k);
b[n] = h
}
})(window, document, "script", "branch", function (b, r) {
b[r] = function () {
b._q.push([r, arguments])
}
}, {
_q: [],
_v: 1
},
"data first init link logout setIdentity track logEvent disableTracking qrCode"
.split(" "), 0);
// Pass the device's advertising id through 'options' with the corresponding key (https://help.branch.io/developers-hub/docs/connected-basic-integration#advertising-id-index)
const options = {
advertising_ids: {
SAMSUNG_IFA: 'xxxxx',
}
};
// init Branch
branch.init('key_live_YOUR_KEY_GOES_HERE', options);
</script>
</head>
<body></body>
</html>
- Change
key_live_YOUR_KEY_GOES_HERE
to match your Branch Dashboard - If you'd like to use a specific version of the SDK, point to https://cdn.branch.io/branch-connected-x.xx.x.min.js (e.g. https://cdn.branch.io/branch-connected-2.47.1.min.js) rather than https://cdn.branch.io/branch-connected-latest.min.js when initializing.
NPM
npm install branch-connected-sdk
import branch from 'branch-connected-sdk'
// Pass the device's advertising id through 'options' with the corresponding key (https://help.branch.io/developers-hub/docs/connected-basic-integration#advertising-id-index)
const options = {
advertising_ids: {
SAMSUNG_IFA: 'xxxxx',
}
};
// init Branch
branch.init('key_live_YOUR_KEY_GOES_HERE', options);
- Change
key_live_YOUR_KEY_GOES_HERE
to match your Branch Dashboard - If you'd like to use a specific version of the SDK, point to
npm install [email protected]
or update yourpackage.json
and rerunnpm install
Advertising ID Index
Device | Key |
---|---|
Samsung | SAMSUNG_IFA |
LG | LG_IFA |
Panasonic | PANASONIC_IFA |
Playstation | PLAYSTATION_IFA |
Xbox | XBOX_MSAI |
Roku | ROKU_RIDA |
Updated over 1 year ago