﻿---
title: API reference
description: The API reference documentation is divided into three parts: The Agent API - All functions and properties on the Agent object. An instance of the Agent...
url: https://www.elastic.co/elastic/docs-builder/docs/3001/reference/apm/agents/rum-js/api-reference
products:
  - APM Agent
  - APM RUM JavaScript Agent
applies_to:
  - Elastic Cloud Serverless: Unavailable
  - Elastic Stack: Generally available
---

# API reference
The API reference documentation is divided into three parts:
- [The `Agent` API](https://www.elastic.co/elastic/docs-builder/docs/3001/reference/apm/agents/rum-js/agent-api) - All functions and properties on the `Agent` object. An instance of the `Agent` object is acquired by calling the `init method` the agent either via script element on the page or require the `elastic-apm-rum` module in Node.js. The `Agent` instance is usually referred to by the variable `apm` in this documentation.
- [The `Transaction` API](https://www.elastic.co/elastic/docs-builder/docs/3001/reference/apm/agents/rum-js/transaction-api) - All functions and properties on the `Transaction` object. An instance of the `Transaction` object is acquired by calling `apm.startTransaction()`.
- [The `Span` API](https://www.elastic.co/elastic/docs-builder/docs/3001/reference/apm/agents/rum-js/span-api) - All functions and properties on the `Span` object. An instance of the `Span` object is acquired by calling `apm.startSpan()`.