Transition guide for the Chirp Connect JavaScript SDK (v2 to v3)

The Chirp Connect Javascript SDK allows you to send payloads to a receiving device.

(Please notice that the Javascript SDK is send only)

Importing it into the project

Note: the URL of your website/project needs to be in the valid origins list, inside the Admin Centre.

After Downloading the file from the Admin Centre.

<script src="PATH_TO/chirp-v3.min.js"></script>


The new v3 SDK is more lightweight than its predecessor and less invasive, allowing the user to have more control over how it operates.

Instead of being appended to the DOM when the file is imported as a script, the new SDK only requests an ApplicationKey and a WebAudioContext (this will vary from one browser to another).

Old v2:

var chirpsdk = new ChirpSDK('APPLICATION_KEY', function(err, res) {
  //Catch authentication with callback function.
  if (err) {

In v3: simply add Application Key and pass a valid Web Audio Context.

var Chirp = new ChirpConnect('APPLICATION_KEY', audioContext);


The way v3 sends data has completely changed. A Uint8Array is passed as a parameter to the send() function, this payload gets requested to Chirp’s web-audio-api as an audio file, which then gets played on the WebAudioContext passed at instantiation.

note: send() function has replaced playChirp().

// example payload: [172, 47, 117, 192]
Chirp.send(new Uint8Array([172, 47, 117, 192]), err => {
  if (err) {
  } else {
      'this will be logged after the payload has been played in the browser'

Protocols to Licences

Protocols are now gone and instead we have licences. This is the way Chirp sets the amount of bits sent in each payload, if the data played is audible or inaudible and the data rate.

Licences details are availble in the admin centre.



  • There is not differentiation between sending data online and offline anymore, as we don’t offer associated data in v3. If this feature is still needed it could easily be reimplemented using Firebase for example.
  • Streaming mode has now dissapeared, but it could be easily reimplemented using a recursive function at the end of every send();
const data = {
  // example payload
  payload: [172, 47, 117, 192],
  repeatTimes: 100

let counter = 0;

function streamData(i, payload) {
  if (i >= data.repeatTimes) {
  counter = +1;
  Chirp.send(new Uint8Array(payload), () => streamData(counter, payload));

streamData(counter, data.payload);
  • The functions getChirp() and createChirp() have disappeared, because we don’t have the concept of online data anymore.
  • Data is not being stored in a database anymore, as the audio is retrieved from the Audio API server, hence why encodeChirp() does not exist as well.
  • The terms identifier/identifierEncoded/Chirp has been renamed to payload.