inploi SDK

Getting Started

Set up the inploi SDK to start using any plugins

npm

Get your API Key

Get a publishable key from your dashboard:

dashboard.inploi.com

Install the SDK

npm install @inploi/sdk
pnpm add @inploi/sdk
bun add @inploi/sdk

Initialise the SDK

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

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

Test it to ensure it works

// Sends a simple page-view event and logs the outcome
sdk.analytics.log({ event: 'VIEW_PAGE' }).then(result => {
	console.log(result.success ? 'inploi analytics OK' : 'inploi analytics FAILED', result);
});

CDN

Get your API Key

Get a publishable key from your dashboard:

dashboard.inploi.com

Load the SDK

<script defer src="https://unpkg.com/@inploi/sdk/cdn/index.js"></script>

Initialise the SDK

<script>
	document.addEventListener('DOMContentLoaded', () => {
		const sdk = inploi.initialiseSdk({
			publishableKey: 'pk_...',
			env: 'sandbox', // or 'production'
		});
	});
</script>

Test it to ensure it works

<script>
	document.addEventListener('DOMContentLoaded', async () => {
		const sdk = inploi.initialiseSdk({ publishableKey: 'pk_...', env: 'sandbox' });
		const result = await sdk.analytics.log({ event: 'VIEW_PAGE' });
		console.log(result.success ? 'inploi analytics OK' : 'inploi analytics FAILED', result);
	});
</script>

Environments

  • sandbox: test environment; data may be purged periodically
  • production: live environment; real data and analytics

Load scripts from the CDN without blocking rendering. Use ordered, non‑blocking scripts so the SDK loads before plugins. See UNPKG usage:

unpkg.com

.

Next steps