Skip to main content

Client

A Client is the part of the SDK that is responsible for event creation. To give an example, the Client should convert an exception to a Sentry event.

The Client should be stateless, it gets the Scope injected and delegates the work of sending the event to the Transport.

Functions

CaptureEvent

Client:CaptureEvent(
EventEvent,
Hint{[string]any},
ScopeScope
) → ()

Captures the event by merging it with other data with defaults from the client.

In addition, if a scope is passed to this system, the data from the scope passes it to the internal transport.

Close

Client:Close(Timeoutnumber?) → ()

Flushes out the queue for up to timeout seconds. If the client can guarantee delivery of events only up to the current point in time this is preferred. This might block for timeout seconds.

The client is disabled after this method is called.

Flush

Client:Flush(Timeoutnumber?) → ()

Same as close difference is that the client is NOT disposed after invocation.

Show raw api
{
    "functions": [
        {
            "name": "CaptureEvent",
            "desc": "Captures the event by merging it with other data with defaults from the client.\n\nIn addition, if a scope is passed to this system, the data from the scope\npasses it to the internal transport.",
            "params": [
                {
                    "name": "Event",
                    "desc": "",
                    "lua_type": "Event"
                },
                {
                    "name": "Hint",
                    "desc": "",
                    "lua_type": "{[string]: any}"
                },
                {
                    "name": "Scope",
                    "desc": "",
                    "lua_type": "Scope"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 35,
                "path": "src/Hub/Client.lua"
            }
        },
        {
            "name": "Close",
            "desc": "Flushes out the queue for up to timeout seconds. If the client can guarantee\ndelivery of events only up to the current point in time this is preferred. This\nmight block for timeout seconds.\n\nThe client is disabled after this method is called.",
            "params": [
                {
                    "name": "Timeout",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 61,
                "path": "src/Hub/Client.lua"
            }
        },
        {
            "name": "Flush",
            "desc": "Same as close difference is that the client is NOT disposed after invocation.",
            "params": [
                {
                    "name": "Timeout",
                    "desc": "",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 68,
                "path": "src/Hub/Client.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Client",
    "desc": "A Client is the part of the SDK that is responsible for event creation. To give\nan example, the Client should convert an exception to a Sentry event.\n\nThe Client should be stateless, it gets the Scope injected and delegates the\nwork of sending the event to the Transport.",
    "source": {
        "line": 18,
        "path": "src/Hub/Client.lua"
    }
}