---
updatedAt: 2025-01-30T22:58:24.000Z
agentTools:
  projectIndex: https://docs.logrocket.com/llms.txt
---

# Using LogRocket with Typescript

Typescript definitions are already included in the LogRocket SDK package. There is no separate typings package to install.

## Usage

You can import LogRocket in any of the following ways:

```javascript
// Choice 1: CommonJS import
import LogRocket = require('logrocket');
// This is semantically correct and is the preferred method of importing

// Choice 2: ES6 import syntax
import * as LogRocket from 'logrocket';
// This works since Typescript makes it work, but it's not following
// the ECMAScript Module specification correctly.
```