---
title: "JavaScript SDK Quickstart"
description: "Get started with the TraceRTM JavaScript SDK in minutes"
keywords: [javascript, typescript, sdk, quickstart, tutorial]
---

# JavaScript SDK Quickstart

Get started with the TraceRTM JavaScript SDK in 5 minutes.

## Installation

```bash
npm install @tracertm/sdk
```

## Initialize Client

### TypeScript/ES Modules

```typescript
import { TraceRTM } from '@tracertm/sdk';

const client = new TraceRTM({
  apiKey: 'rtm_live_abc123...'
});
```

### CommonJS

```javascript
const { TraceRTM } = require('@tracertm/sdk');

const client = new TraceRTM({
  apiKey: process.env.TRACERTM_API_KEY
});
```

## Basic Operations

### List Projects

```javascript
const projects = await client.projects.list();
projects.forEach(project => {
  console.log(`${project.id}: ${project.name}`);
});
```

### Create a Project

```javascript
const project = await client.projects.create({
  name: 'My Project',
  description: 'Project description'
});
console.log(`Created project: ${project.id}`);
```

### Create an Item

```javascript
const item = await client.items.create({
  title: 'New Requirement',
  view: 'requirements',
  status: 'draft',
  projectId: 'proj_123'
});
console.log(`Created item: ${item.id}`);
```

### Query Items

```javascript
const items = await client.items.query({
  view: 'requirements',
  status: 'active',
  limit: 50
});

items.forEach(item => {
  console.log(`${item.title}: ${item.status}`);
});
```

## Complete Example

```javascript
import { TraceRTM } from '@tracertm/sdk';

async function main() {
  const client = new TraceRTM({
    apiKey: process.env.TRACERTM_API_KEY
  });

  // Create project
  const project = await client.projects.create({
    name: 'Example Project',
    description: 'Example project for quickstart'
  });

  // Create requirement
  const requirement = await client.items.create({
    title: 'User Authentication',
    view: 'requirements',
    status: 'draft',
    projectId: project.id,
    metadata: { priority: 'high' }
  });

  // Create test case
  const testCase = await client.items.create({
    title: 'Login Test',
    view: 'test-cases',
    status: 'draft',
    projectId: project.id
  });

  // Create link
  const link = await client.links.create({
    sourceId: requirement.id,
    targetId: testCase.id,
    linkType: 'verified_by',
    metadata: { confidence: 0.95 }
  });

  console.log(`Created: ${requirement.title} --[verified_by]--> ${testCase.title}`);
}

main().catch(console.error);
```

## Next Steps

- [Authentication](./03-authentication) - Authentication options
- [Artifacts](./04-artifacts) - Working with items
- [Examples](./06-examples) - More examples
