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

# Quickstart: Log Your First Audit Event in 5 Minutes

> Create a free AuditRails account, install your language's SDK, and send your first tamper-proof audit event in under five minutes. No credit card required.

This guide walks you from zero to your first tamper-proof audit event. You'll create a free account, grab an API key, install the SDK for your language, and send a real event that you can immediately inspect in the AuditRails dashboard. The entire process takes about five minutes.

<Steps>
  <Step title="Create Your Free Account">
    Head to [app.auditrails.io/register](https://app.auditrails.io/register) and sign up for a free account. You get a **90-day free trial** with no credit card required — full platform access from day one.

    <Tip>
      Your account starts on the Starter Trails plan. You can upgrade at any time from **Dashboard → Billing** without losing any existing log data.
    </Tip>
  </Step>

  <Step title="Create an API Key">
    Every event is authenticated with an API key scoped to a project. To create one:

    1. Open the [AuditRails Dashboard](https://app.auditrails.io).
    2. Navigate to **API Keys** in the left sidebar.
    3. Click **Create API Key**, give it a name (e.g. `my-app-dev`), and select the project you want to scope it to.
    4. Copy the key immediately — it starts with `at_live_...` and is **shown only once**.

    <Warning>
      AuditRails stores only a SHA-256 hash of your key, never the raw value. If you lose it, you must revoke it and create a new one. Store it in a secrets manager or environment variable right away.
    </Warning>
  </Step>

  <Step title="Install the SDK">
    Choose the package for your language and runtime:

    <CodeGroup>
      ```bash Node.js theme={null}
      npm install @auditrails/node
      ```

      ```bash PHP theme={null}
      composer require auditrails/auditrails-php
      ```

      ```bash Python theme={null}
      pip install auditrails
      ```

      ```bash Go theme={null}
      go get github.com/auditrails/auditrails-go
      ```

      ```xml Java (Maven) theme={null}
      <dependency>
        <groupId>io.auditrails</groupId>
        <artifactId>auditrails-java</artifactId>
        <version>1.0.0</version>
      </dependency>
      ```
    </CodeGroup>
  </Step>

  <Step title="Log Your First Event">
    Initialize the client with your API key and send a `user.login` event. Replace `at_live_...` with the key you copied in step 2.

    <CodeGroup>
      ```javascript Node.js theme={null}
      import { AuditRails } from '@auditrails/node';

      const audit = new AuditRails({ apiKey: 'at_live_...' });

      await audit.log({
        action: 'user.login',
        actorId: 'user_123',
        resource: 'session/sess_abc',
        metadata: {
          ip: '203.0.113.1',
          method: 'password',
        },
      });
      ```

      ```php PHP theme={null}
      use AuditRails\AuditRails;

      $audit = new AuditRails(
          new Config(apiKey: 'at_live_...'),
          new Client(),
          new HttpFactory(),
          new HttpFactory()
      );

      $audit->log(new AuditEvent(
          action: 'user.login',
          actorId: 'user_123',
          resource: 'session/sess_abc',
          metadata: ['ip' => '203.0.113.1', 'method' => 'password']
      ));
      ```

      ```python Python theme={null}
      from auditrails import AuditRails, AuditRailsConfig

      audit = AuditRails(AuditRailsConfig(api_key='at_live_...'))

      audit.log({
          'action': 'user.login',
          'actor_id': 'user_123',
          'resource': 'session/sess_abc',
          'metadata': {
              'ip': '203.0.113.1',
              'method': 'password',
          },
      })
      ```

      ```go Go theme={null}
      package main

      import "github.com/auditrails/auditrails-go"

      func main() {
          client, _ := auditrails.New("at_live_...", auditrails.Options{})
          defer client.Close()

          client.Log(auditrails.Event{
              Action:   "user.login",
              ActorID:  "user_123",
              Resource: "session/sess_abc",
              Metadata: map[string]any{
                  "ip":     "203.0.113.1",
                  "method": "password",
              },
          })
      }
      ```

      ```java Java theme={null}
      import io.auditrails.AuditRails;
      import io.auditrails.AuditEvent;
      import java.util.Map;

      try (AuditRails audit = AuditRails.builder("at_live_...").build()) {
          audit.log(
              AuditEvent.builder("user.login")
                  .actorId("user_123")
                  .resource("session/sess_abc")
                  .metadata(Map.of(
                      "ip", "203.0.113.1",
                      "method", "password"
                  ))
                  .build()
          );
      }
      ```
    </CodeGroup>

    <Info>
      The SDK automatically attaches a `log_id` (ULID), your `tenant_id`, and a precise `timestamp` to every event before it is hashed and stored. You never need to set these manually.
    </Info>
  </Step>

  <Step title="View Your Event in the Dashboard">
    Open [Dashboard → Logs](https://app.auditrails.io/logs). Your `user.login` event should appear within a few seconds. Click any row to inspect:

    * The full event payload and metadata
    * The computed SHA-256 hash and its position in the chain
    * The previous-hash link that proves chain integrity
    * The WORM storage confirmation and retention expiry date
  </Step>
</Steps>

## What's Next

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="lightbulb" href="/concepts">
    Understand projects, events, hash chains, storage tiers, and retention policies.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn about API key formats, security best practices, and error codes.
  </Card>

  <Card title="API Reference" icon="terminal" href="/api-reference/overview">
    Explore every endpoint and field in the full REST API reference.
  </Card>

  <Card title="Compliance Guides" icon="clipboard-check" href="/guides/compliance-mapping">
    See how AuditRails satisfies SOC 2, HIPAA, GDPR, PCI DSS, and 13 more frameworks.
  </Card>
</CardGroup>
