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

# Signer & Tracing Reference

> Developer-facing sec0-sdk/signer and sec0-sdk/otel APIs used during integration.

Most integrations only need two things from these packages:

* `LocalDevSigner.fromKeyRef(...)` to provide a signer to middleware, gateway, or audit setup
* `initTracing(...)` to point Sec0 traces at your OTLP collector

## signer

### LocalDevSigner

| Method                      | Signature                            | Description                                        |
| --------------------------- | ------------------------------------ | -------------------------------------------------- |
| `LocalDevSigner.fromKeyRef` | `(keyRef: string) => LocalDevSigner` | Load a base64 Ed25519 key from a `file://...` path |

### Signer interface

| Member  | Type                                         | Description    |            |
| ------- | -------------------------------------------- | -------------- | ---------- |
| `keyId` | string                                       | Key identifier |            |
| `sign`  | \`(data: Uint8Array) => Promise\<Uint8Array> | Uint8Array\`   | Sign bytes |

### Example

```typescript theme={null}
import { LocalDevSigner } from "sec0-sdk/signer";

const signer = LocalDevSigner.fromKeyRef("file://./.sec0/keys/ed25519.key");

console.log("keyId:", signer.keyId);
```

`fromKeyRef(...)` only accepts `file://` paths and honors the allowed key directories controlled by `SEC0_SIGNER_KEY_DIRS`.

## otel

### OTelConfig

| Key              | Type         | Required | Description                  |
| ---------------- | ------------ | -------- | ---------------------------- |
| `endpoint`       | string       | Yes      | OTLP/gRPC collector endpoint |
| `serviceName`    | string       | Yes      | Service name                 |
| `serviceVersion` | string       | Yes      | Service version              |
| `environment`    | string       | Yes      | Environment name             |
| `tenant`         | string       | Yes      | Tenant identifier            |
| `sample.success` | number (0-1) | Yes      | Success sampling ratio       |
| `sample.error`   | number (0-1) | No       | Error sampling ratio         |

### initTracing

```typescript theme={null}
import { initTracing } from "sec0-sdk/otel";

initTracing({
  endpoint: "https://your-otlp-endpoint",
  serviceName: "orders-server",
  serviceVersion: "1.0.0",
  environment: "dev",
  tenant: "my-app",
  sample: { success: 1, error: 1 },
});
```

Most Sec0 integrations do not need manual span helpers. Decorators, middleware, and gateway integrations already emit the expected spans and attributes for you.
