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

# Using aven-stellar as an npm Package

> Install and consume the aven-stellar npm package programmatically to embed work-session tracking and submission inside your own Node.js tooling.

The `aven-stellar` package ships both a CLI (documented in the [CLI Guide](/cli/overview)) and a programmatic API for embedding session tracking directly in your Node.js applications.

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install aven-stellar
  ```

  ```bash pnpm theme={null}
  pnpm add aven-stellar
  ```

  ```bash yarn theme={null}
  yarn add aven-stellar
  ```
</CodeGroup>

## Programmatic API

```ts theme={null}
import { startSession, stopSession } from "aven-stellar";

const session = await startSession({
  streamId: "CSTREAM...",
  repoPath: process.cwd(),
});

// ... time passes, code is committed ...

const report = await stopSession({
  sessionId: session.id,
  submit: true, // submit on-chain immediately
});

console.log("Attestation tx:", report.txHash);
```

## What the package exports

| Export                 | Purpose                                                 |
| ---------------------- | ------------------------------------------------------- |
| `startSession(opts)`   | Begin a tracked work session tied to a Stream.          |
| `stopSession(opts)`    | Finalize the session and optionally submit it on-chain. |
| `readReport(path)`     | Load a locally-saved session report.                    |
| `verifyReport(report)` | Recompute the report's signature and Git hash chain.    |

<Note>
  For interactive terminal usage, prefer the CLI. The programmatic API is intended for CI jobs, custom dashboards, and headless environments.
</Note>

<Card title="CLI reference" icon="terminal" href="/cli/commands">
  Full command-line documentation for `aven-stellar start` and `aven-stellar stop`.
</Card>
