Set up your Telemetree Go SDK
Install analytics-go using go get:
Create a Telemetree SDK client by providing the Project ID and API Key.
Send an event with user and event data.
The client returns typed errors, which are specifically defined in the github.com/Telemetree/telemetree-go/telemetree/errors
package.
These custom error types provide more detailed information about specific error scenarios, making error handling more precise and informative.
The following error types are defined in the github.com/Telemetree/telemetree-go/telemetree/errors
package:
ClientInitializationError
: Represents errors occurring during client initialization, with an associated reason.EventValidationError
: Represents validation errors for event fields, with the specific field that failed validation.EventPreparationError
: Represents errors during event preparation, including a description of the failure.EventSendError
: Represents errors encountered when sending events, with a description of the error.You can use type assertion or errors.As
to handle these errors in a type-safe manner and access the underlying details.
The SDK uses RSA encryption to secure event data before sending it to the Telemetree service, ensuring data privacy. The publicKey
is fetched automatically from the Telemetree configuration service during initialization, so there’s no need to manually set it.
Consider visiting our resources for more info about the state of the Telegram Mini Apps ecosystem and Telegram analytics.
Set up your Telemetree Go SDK
Install analytics-go using go get:
Create a Telemetree SDK client by providing the Project ID and API Key.
Send an event with user and event data.
The client returns typed errors, which are specifically defined in the github.com/Telemetree/telemetree-go/telemetree/errors
package.
These custom error types provide more detailed information about specific error scenarios, making error handling more precise and informative.
The following error types are defined in the github.com/Telemetree/telemetree-go/telemetree/errors
package:
ClientInitializationError
: Represents errors occurring during client initialization, with an associated reason.EventValidationError
: Represents validation errors for event fields, with the specific field that failed validation.EventPreparationError
: Represents errors during event preparation, including a description of the failure.EventSendError
: Represents errors encountered when sending events, with a description of the error.You can use type assertion or errors.As
to handle these errors in a type-safe manner and access the underlying details.
The SDK uses RSA encryption to secure event data before sending it to the Telemetree service, ensuring data privacy. The publicKey
is fetched automatically from the Telemetree configuration service during initialization, so there’s no need to manually set it.
Consider visiting our resources for more info about the state of the Telegram Mini Apps ecosystem and Telegram analytics.