> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inploi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Set up the inploi SDK in your project

# Getting Started

Get up and running with the inploi SDK in minutes.

## Prerequisites

* An inploi account with a publishable API key from [studio.inploi.com](https://studio.inploi.com)

## Installation

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @inploi/sdk
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @inploi/sdk
    ```
  </Tab>

  <Tab title="bun">
    ```bash theme={null}
    bun add @inploi/sdk
    ```
  </Tab>
</Tabs>

## Initialize the SDK

```typescript theme={null}
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:

```typescript theme={null}
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:

```html theme={null}
<script defer src="https://sdk.inploi.com/@inploi/sdk/cdn/index.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', () => {
    const sdk = inploi.initialiseSdk({
      publishableKey: 'pk_...',
      env: 'sandbox',
    });
  });
</script>
```

You can also use `inploi.ready()` as a shorter alternative to `DOMContentLoaded`:

```javascript theme={null}
inploi.ready(() => {
  const sdk = inploi.initialiseSdk({ publishableKey: 'pk_...', env: 'sandbox' });
});
```

`inploi.ready(callback)` runs the callback once the document is parsed. If the document is already loaded, the callback is scheduled on the microtask queue (via `Promise.resolve().then()`), similar to `DOMContentLoaded` timing for typical integrations.

## Environments

| Environment  | Description                                        |
| ------------ | -------------------------------------------------- |
| `sandbox`    | Test environment - data may be purged periodically |
| `production` | Live environment - real data and analytics         |

<Tip>
  Start with `sandbox` during development, then switch to `production` when you're ready to go live.
</Tip>

## CDN caching and minification

If your site uses a server-side caching or minification plugin, you must exclude the inploi SDK scripts from it. These plugins can download and serve a stale local copy, preventing your site from receiving updates and bug fixes.

Exclude all `https://sdk.inploi.com/*` URLs from any caching, minification, or asset bundling. Check your CMS or hosting provider's documentation for how to add script exclusions.

<Warning>
  Failing to exclude these URLs can result in the widget displaying incorrectly or missing functionality. The SDK is already optimised and minified — additional minification by your CMS can break it.
</Warning>

## Next steps

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

<CardGroup cols={2}>
  <Card title="Kin Plugin" icon="message-bot" href="/sdk/plugins/kin">
    Add an AI chat assistant
  </Card>

  <Card title="Job Search Plugin" icon="magnifying-glass" href="/sdk/plugins/job-search">
    Add a job search widget
  </Card>
</CardGroup>
