Skip to main content

CDN

Learn how to add Shake to your Web app using CDN.

You're viewing the Web docs. Other platforms →   iOS  Android  React Native  Flutter  Chrome extension 

Create a new app on Dashboard​

Visit your Shake Dashboard and add a new Web app by clicking the Add new app button located in the bottom right corner.

Add new app

Once you're done, you're ready to proceed with the steps below.

Add script element to your page​

Shake can be added to your project through CDN. Bundle is delivered through JSDelivr CDN.

Add the following script to your code:

index.html
<script type="module">
import Shake from 'https://cdn.jsdelivr.net/npm/@shakebugs/browser@latest/+esm'
window.Shake = Shake;
</script>

Make sure that you're using the latest Shake .

Initialize Shake​

Call Shake.start() in your main file. Replace app-api-key with the actual value you have in your app settings:

index.js
window.Shake.start('app-api-key');

Now build and run your project. Shake should be working, as simple as that.

Setting your app version​

Unlike native mobile apps, web apps don't have a built-in versioning system, so Shake can't detect your app version automatically. Pass it as the optional second argument to Shake.start():

index.js
window.Shake.start('app-api-key', '1.0.0');

If you don't pass a version, it defaults to "1.0.0". This version is shown alongside each session on your Releases dashboard.

Conditional initialization​

We recommend initializing Shake in the entry point of your app. However, depending on your app, you'll want to initialize Shake just in a specific conditions, depending on your app data. You can do it as shown in the example below when your app data is available:

index.js
if (User.isTester) {
window.Shake.start('app-api-key');
}

Visit your Shake dashboard​

Follow the instructions there to send your first feedback with Shake and you're all set.

SDK customizations​

Now that Shake SDK is in your app and you have sent the first feedback for fun, everything else is optional. As the next step, try the three most popular SDK customizations: