Skip to main content

Getting Started

Get up and running with the inploi SDK in minutes.

Prerequisites

Installation

npm install @inploi/sdk

Initialize the SDK

import { initialiseSdk } from '@inploi/sdk';

const sdk = initialiseSdk({
  publishableKey: 'pk_...', // Your publishable key
  env: 'sandbox', // or 'production'
});

Verify it works

Send a test event to confirm the SDK is configured correctly:
sdk.analytics.log({ event: 'VIEW_PAGE' }).then(result => {
  console.log(result.success ? 'inploi SDK OK' : 'inploi SDK FAILED', result);
});

CDN Installation

If you’re not using a build system, you can load the SDK directly:
<script defer src="https://unpkg.com/@inploi/sdk/cdn/index.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', () => {
    const sdk = inploi.initialiseSdk({
      publishableKey: 'pk_...',
      env: 'sandbox',
    });
  });
</script>

Environments

EnvironmentDescription
sandboxTest environment - data may be purged periodically
productionLive environment - real data and analytics
Start with sandbox during development, then switch to production when you’re ready to go live.

Next steps

Now that the SDK is initialized, add plugins to enable features: