Getting Started
Set up the inploi SDK to start using any plugins
npm
Install the SDK
npm install @inploi/sdkpnpm add @inploi/sdkbun add @inploi/sdkInitialise 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
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
- Install and register plugins (see guides):