Installation

Learn how to integrate Croct into your JavaScript project.

Croct's mascot winking
Looking for a speedy start?

For a more streamlined setup, go to the Integration page of your workspace and you will find instructions tailored to your application.

Prerequisites

To get most out of this guide, you have to:

Install the SDK

Choose one of the following methods to install the SDK:

  • Run the following command to install the SDK:

    npm install @croct/plug

Initialize the provider

To initialize the SDK, use the following code snippet:

app.js
12345
import croct from '@croct/plug';
croct.plug({
appId: 'APPLICATION_ID'
});

You can find the Application ID on the Integration page of your application. For a list of all available options, refer to the plug documentation.

Check your integration

If you open your application now, it should start sending events.

To check if your integration is working, go to the Integration page of your application.

Integration status

When working correctly, you should see a green bullet next to the Status label saying "Received traffic in the past 24 hours". If you still do not see this message after a few minutes, see the Troubleshooting reference.