Vapor-telemetrydeck - Vapor client for posting signals to TelemetryDeck, a privacy-conscious analytics service for apps and websites

Overview

TelemetryDeck client for Vapor

Documentation Team Chat MIT License Continuous Integration Swift 5.2

Usage

Once you have added the package to your project, you must initialise the library. This is usually done in configure.swift.

")">
import TelemetryDeck

app.telemetryDeck.initialise(appID: "
    
     "
    )

Sending a Signal

There are two ways to send a signal. One method is from the "system", which contains a static user identifier.

try await app.telemetryDeck.send("applicationStarted")

The second option is from a request, this will set the user identifier to be a hashed version of the request IP address.

String in try await req.telemetryDeck.send("homePage") return "your page content" }">
try await request.telemetryDeck.send("homePage")

// for example:

app.get("home") { req async throws -> String in
  try await req.telemetryDeck.send("homePage")
  return "your page content"
}

Properties

You can attach additional payload data with each signal by adding additionalPayload to the send functions.

try await app.telemetryDeck.send("applicationStarted", additionalPayload: [
  "host": "gcp"
])

You may also configure TelemetryDeck for Vapor with a dictionary of default properties which are sent with every signal.

app.telemetryDeck.defaultParameters["key"] = "value"

Sessions

With each signal, we send through a session identifier which is a unique UUID generated on initialisation. This is intended to be different for each running instance of your server, changing each time you reboot the server.

Test Mode

If you launch Vapor in a non-release environment, signals will be marked as being in test mode. In the Telemetry Viewer app, actvivate Test Mode to see those.

Signal Batching

This library does not currently support signal batching. This means that signals are sent to TelemetryDeck as you call the functions. In a future release, we may add the capability to batch signals in memory and post them at regular intervals.

You might also like...
A dynamic sitemap generator for Vapor

A dynamic sitemap generator for Vapor

 An ultra-lightweight native Discord client for vintage and modern Mac OS
An ultra-lightweight native Discord client for vintage and modern Mac OS

Discord Lite An ultra-lightweight native Discord client for vintage and modern Mac OS Minimum System Requirements Mac OS X version 10.4 (Tiger) PowerP

An IPFS client/api Swift Package, with the ability to add and pin any data on iOS/iPadOS/macOS

An IPFS client/api Swift Package, with the ability to add and pin any data on iOS/iPadOS/macOS. Originally bundled with GraniteUI, pulled out for independant use by any party.

Github iOS Client  based on Github REST V3 API and GraphQL V4 API
Github iOS Client based on Github REST V3 API and GraphQL V4 API

ZLGithubClient Github iOS 客户端 by Existorlive Objective-c 2.0 Swift 5 Cocoapods 1.9.1 iOS = 11.0 基于 Github REST V3 API 和 Github GraphQL V4 API 开发的iOS客

Monkey is an unofficial GitHub client for iOS,to show the rank of coders and repositories.
Monkey is an unofficial GitHub client for iOS,to show the rank of coders and repositories.

Monkey for GitHub 中文README Monkey is an unofficial GitHub client. Monkey for GitHub is my first App,open source project.Welcome to download. GitHub op

Runtime Mobile Security (RMS) 📱🔥  - is a powerful web interface that helps you to manipulate Android and iOS Apps at Runtime
Runtime Mobile Security (RMS) 📱🔥 - is a powerful web interface that helps you to manipulate Android and iOS Apps at Runtime

Runtime Mobile Security (RMS) 📱 🔥 by @mobilesecurity_ Runtime Mobile Security (RMS), powered by FRIDA, is a powerful web interface that helps you to

The template for Delta Client plugins.

Delta Plugin Template This repository is a template for Delta Client plugins. To create a plugin, create a repo from this template repo and then repla

A simple Hacker News mobile client

A simple Hacker News mobile client. Overview This app was built with the Hacker News API This is one of my first apps outside of a tut

A web API client in Swift built using Async/Await

Web API Client A modern web API client in Swift built using Async/Await and Actors. let client = APIClient(host: "api.github.com") // Using the clien

Comments
  • [td] log error instead of throwing

    [td] log error instead of throwing

    In clients whom intentionally decide to not initialise TelemetryDeck (for example on non-produciton environments, unit tests, etc), they would have to add a wrapper around all the interactions in order to avoid a situation which would throw 500s when used in requests.

    This wasn't intentional, and the error didn't seem relevant enough to warrant a reaction by the client. If you've not registered - it's probably for a reason.

    So we've replaced it with a log instead. May consider making it a one-off, will consider options.

    opened by Sherlouk 0
  • Patch XFF header parsing

    Patch XFF header parsing

    This fixes an issue where 'unique users' was inaccurate due to proxy services essentially adding as a mechanism to unintentionally randomise the identifier.

    This has been tested to be more resilient to this kind of issue.

    opened by Sherlouk 0
  • Replace CryptoKit with SwiftCrypto

    Replace CryptoKit with SwiftCrypto

    Why

    CryptoKit is not supported on Linux builds, which leads to vapor-telemetrydeck not being compatible with deployments onto Linux platforms.

    As Linux deployments are common, and a desired platform for us to support, this dependency replacement is necessary.

    Benefit

    Our package will now support Linux.

    How

    SwiftCrypto is a drop-in replacement for CryptoKit, maintained by Apple themselves and recommended by Vapor.

    opened by Sherlouk 0
  • Allow sending numerical values

    Allow sending numerical values

    The TelemetryDeck Ingestion API now supports numerical float values. This PR adds that ability to the Vapor Client. It's super handy for e.g. sending request duration in a middleware.

    opened by winsmith 0
Releases(1.2.0)
Owner
Sidetrack
An evolution to travelling by train
Sidetrack
You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good

Hope not. Monitor your APIs and websites on your menubar. For macOS. Right now! YyeeeHav!

Steven J. Selcuk 10 Nov 29, 2022
iOS Safari extension for forwarding away from AMP websites

iOS Safari extension for forwarding away from AMP websites

Eric Jacobsen 0 Oct 12, 2022
Inject JavaScript to all websites!

Inject Javascript Safari Extension Hi, so, you want to Inject Javascript to a website? Great. Since this is a very basic (demo) project it has not tha

Wesley De Groot 6 Jun 7, 2022
Keybase Go Library, Client, Service, OS X, iOS, Android, Electron

Keybase Hi, and welcome to the Keybase client repo. All our client apps (macOS, Windows, Linux, iOS, and Android) are being actively developed in this

Keybase 8.3k Dec 31, 2022
An example implementation of using a native iOS Notification Service Extension (to display images in remote push notification) in Titanium.

Titanium iOS Notification Service Extension An example implementation of using a native iOS Notification Service Extension (to display images in remot

Hans Knöchel 8 Nov 21, 2022
The Outline Client is a cross-platform VPN or proxy client for Windows, macOS, iOS, Android, and ChromeOS

Outline Client The Outline Client is a cross-platform VPN or proxy client for Windows, macOS, iOS, Android, and ChromeOS. The Outline Client is design

Jigsaw 7.3k Dec 31, 2022
A movie api created using Vapor, Fluent (ORM) and Postgres

A movie api created using Vapor, Fluent (ORM) and Postgres

Vijay 0 Jan 10, 2022
A template Vapor app with nginx frontend.

This is an example Vapor app. It contains the app itself, as well as surrounding components (Postgres database, nginx frontend for providing secure connection), all runnable out of the box with docker compose. It is a good starting point for Vapor development of an API server which you could access from macOS and iOS clients.

Jaanus Kase 5 Jul 1, 2022
VaporDocC provides middleware for use with Vapor.

VaporDocC provides middleware for use with Vapor. To initialise the middleware pass in the path to your .doccarchive, e.g.:

Joseph Duffy 23 Nov 4, 2022
OpenAPI specification generator for Vapor based Swift projects.

VaporToOpenAPI VaporToOpenAPI is a Swift library which can generate output compatible with OpenAPI version 3.0.1 from Vapor code. You can use generate

null 3 Dec 15, 2022