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

# HintoClient

## Methods

### flush()

```typescript
flush(options?: { keepalive: boolean }): Promise<IngestBatchResponse | null>
```

Sends queued events now.

#### Parameters

<ResponseField name={"options"} type={"{ keepalive: boolean }"} />

#### Returns

<code>{"Promise<"}[IngestBatchResponse](/sdk/index/interfaces/IngestBatchResponse){" | null>"}</code>

### identify()

```typescript
identify(identity: SessionIdentity | null): void
```

Attaches the session to a customer. `null` at sign-out starts a new anonymous session and
erases the old customer's journeys. With Native Support, the conversation runtime sets the
identity; another identity kind replaces the one it checks, so sends fail.

#### Parameters

<ResponseField name={"identity"} type={"SessionIdentity | null"} required>
  **Type:** <code>[SessionIdentity](/sdk/index/interfaces/SessionIdentity){" | null"}</code>
</ResponseField>

### journey()

```typescript
journey(key: string, options?: JourneyStartOptions): JourneyHandle
```

Returns this tab's open instance of the journey `key`, or starts one and reports `started`.
Calling it again while the instance is open returns the same instance, across reloads and
same-tab redirects. After `succeed()`, the next call starts a new instance.

Journeys need a signed-in subject: `initialIdentity`, or a bound conversation. Without one,
or with an invalid key or metadata, the handle is inert and `instanceId` is null.

#### Parameters

<ResponseField name={"key"} type={"string"} required>
  A token: a lowercase letter, then up to 38 lowercase letters, digits, or `_`.
</ResponseField>

<ResponseField name={"options"} type={"JourneyStartOptions"} typeHref={"/sdk/index/interfaces/JourneyStartOptions"} />

#### Returns

<code>[JourneyHandle](/sdk/index/interfaces/JourneyHandle)</code>

### journeyRefs()

```typescript
journeyRefs(): JourneyRef[]
```

The journeys a support conversation links to: open instances and those that succeeded in the
last 10 minutes, newest activity first, at most 5. Each ref names the last step reported.

#### Returns

<code>[JourneyRef](/sdk/index/interfaces/JourneyRef){"[]"}</code>

### onJourneyUpload()

```typescript
onJourneyUpload(listener: () => void): () => void
```

Calls `listener` each time an upload carrying the current subject's journey steps reaches
Hinto, so a help offer read can follow at once. Returns a function that stops the calls. Optional: a capture client without
it still works, and `runtime.offers` then notices new steps within 2 seconds.

#### Parameters

<ResponseField name={"listener"} type={"() => void"} required />

#### Returns

`() => void`

### shutdown()

```typescript
shutdown(): void
```

Stops capture at once. Events not yet sent are dropped, including a send in progress;
`await flush()` first to send them.

### track()

```typescript
track(name: string, properties?: Record<string, unknown>): void
```

Records a custom event with redacted properties.

#### Parameters

<ResponseField name={"name"} type={"string"} required />

<ResponseField name={"properties"} type={"Record<string, unknown>"} />


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.