Skip to content

ShardlensHttpOptions

Defined in: packages/http/src/index.ts:45

optional apiKey?: string

Defined in: packages/http/src/index.ts:49

Ingest-only API key (slk_ingest_…). On Workers, keep it in a secret (wrangler secret put).


optional auditIncludeProfile?: boolean

Defined in: packages/http/src/index.ts:53

Audit mode only: send each user’s username and avatar with their ID. Default true; false records IDs only.


optional captureOptionValues?: readonly string[]

Defined in: packages/http/src/index.ts:61

Option names whose values may be recorded. Values of user, channel, role, mentionable and attachment options, and any value holding a Discord ID, are never recorded; strings are cut to 100 characters, secrets redacted. Default none.


optional dryRun?: boolean

Defined in: packages/http/src/index.ts:77

Print events instead of sending them.


optional endpoint?: string

Defined in: packages/http/src/index.ts:47

Your collector’s URL. HTTPS, or HTTP to localhost only. Leave out with apiKey to use exporters only.


optional environment?: string

Defined in: packages/http/src/index.ts:65

Separates staging from production. Default 'production'.


optional exporters?: readonly ShardlensExporter[]

Defined in: packages/http/src/index.ts:75

In-process metrics exporters. They get every event, never with a user.


optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/http/src/index.ts:81

Override fetch (tests, proxies).

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional instance?: string

Defined in: packages/http/src/index.ts:69

A label for this deployment in SDK health, for example the Worker name. Default 'http'.


optional logger?: Logger

Defined in: packages/http/src/index.ts:79

Where SDK warnings go. Default console.


optional mode?: "privacy" | "audit"

Defined in: packages/http/src/index.ts:51

'privacy' (default) or 'audit'; audit only takes effect when the collector is in audit mode too.


optional normaliseCustomId?: (customId) => string

Defined in: packages/http/src/index.ts:63

Replaces the default custom-ID normaliser (numbers and IDs become *).

string

string


optional optedOut?: Iterable<string | bigint, any, any>

Defined in: packages/http/src/index.ts:71

Users who opted out earlier. Their events are dropped in-process. BigInt IDs from a database are accepted.


optional release?: string

Defined in: packages/http/src/index.ts:67

Your bot’s version, to compare releases.


optional saltPeriod?: SaltPeriod

Defined in: packages/http/src/index.ts:55

Informational; the collector decides. Default 'month'.


optional sampleRate?: Readonly<Record<string, number>>

Defined in: packages/http/src/index.ts:73

Sample rate per event type in (0, 1].