Indent JavaScript SDK

The Indent JavaScript SDK provides your JavaScript and TypeScript applications access to Indent.

You can install the SDK with Yarn or NPM:

yarn add @indent/audit

npm i -S @indent/audit

Or using our script tag:


Looking to add Indent to your website? Follow this guide.

View the source code on GitHub.

After you've installed the SDK, you can include it in your JS application with your Input's DSN. You can put your INPUT_DSN in an environment variable or copy the code from that page:

import { audit } from '@indent/audit'

audit.init({ dsn: '' })

Once you've initalized your client, you can start writing audit events:

const pageview = url =>
    event: 'page_viewed',
    actor: { id: window.appUserId || 'anonymous' },
    resources: [{ kind: 'http/url', id: url || window.location.href }]

  dsn: '',
  debug: false
    event: 'page_viewed',
    actor: { id: 'anonymous', altIds: ['ip-addr/'] },
    resources: [
        kind: 'http/url',
        id: ''
  // Optional object for passing options like `flushImmediately`
  // to immediately flush queued events to the Indent Audit API.
    flushImmediately: true

Chat with an engineer or let us know if you’d like to work with Indent in a different language or with a specific framework.