Package-level declarations

Types

Link copied to clipboard

Configuration for the Autograph builder.

Link copied to clipboard

Captures the application Context at app startup so the default SeqStore can use it.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.ERROR, message = "This is an Autograph-internal API shared between Autograph's own modules. It is not a supported public API and can change or be removed in any release.")
annotation class AutographInternalApi

Marks a declaration that exists only so Autograph's own modules can share it across a module boundary — not a supported API for library users. It may change or disappear in any release, including a patch.

Link copied to clipboard
fun interface AutographLogger

Sink for the library's own diagnostic messages — a delivery that failed, or an event dropped because it did not validate. Set one on AutographConfig.logger to route these into your app's logging framework (Logcat, os_log, Timber, …) or to silence them; the default prints to the console, matching the library's historical behavior.

Link copied to clipboard
class DebugTransport(delegate: Transport, log: (String) -> Unit = ::println) : Transport

Wraps delegate, logging every event before delivering it — for eyeballing outgoing events on a real device/build during manual QA, separate from the app's production transport. Not connected to a warehouse or any assertion tooling (see the planned autograph-test module for unit-test assertions instead).

Link copied to clipboard
data class Envelope

The instrumentation envelope stamped onto every event.

Link copied to clipboard
interface EnvelopeSource

Provides instrumentation envelopes. Implemented by the library core; transports that run their own event pipeline (e.g. Segment) call stamp from inside that pipeline so that sequence numbers match the actual enqueue order — including events the transport generates itself, such as lifecycle events.

Link copied to clipboard
object EventId

Built-in EventIdGenerator strategies.

Link copied to clipboard
fun interface EventIdGenerator

Generates a unique identifier for each event.

Link copied to clipboard
fun interface EventValidator

Checks a track/screen event against an app-defined tracking-plan contract — a fixed set of event types, required properties, naming conventions — before it reaches the transport.

Link copied to clipboard

A non-persistent SeqStore for tests or ephemeral configurations.

Link copied to clipboard
sealed interface SeqPersistence

Controls how sequence counters are persisted.

Link copied to clipboard
interface SeqStore

Minimal key-value persistence used for sequence counters and session state.

Link copied to clipboard

Controls which sequence numbers are stamped into the event envelope.

Link copied to clipboard
data class SessionConfig(val backgroundTimeout: Duration = 30.minutes)

Session semantics: a session ends when the app has been inactive for longer than backgroundTimeout. Session state is persisted, so a session survives process restarts as long as activity resumes within the timeout.

Link copied to clipboard
data class SessionInfo

A snapshot of the session an event belongs to.

Link copied to clipboard
interface Tracker

The main entry point for recording analytics events.

Link copied to clipboard
interface Transport

SPI implemented by transport adapters (e.g. autograph-segment).

Properties

Link copied to clipboard
val EmptyJsonObject: JsonObject

An empty JsonObject, useful as a default for event properties.

Functions

Link copied to clipboard
fun Autograph(configure: AutographConfig.() -> Unit): Tracker

Creates a Tracker.

Link copied to clipboard
fun createEnvelope(eventId: String, sessionId: String, sessionStartEpochMillis: Long, seq: Long?, globalSeq: Long?, sdk: String, eventTimestamp: String, schemaVersion: String? = null): Envelope

Builds an Envelope with caller-chosen field values, bypassing the stamper.

Link copied to clipboard

Returns the platform-default SeqStore: a FileSeqStore under the app's private data directory, or an InMemorySeqStore if no writable directory is available (in which case counters do not survive a restart).