Friendship Tracker

Client libraries

Drop-in API wrappers for Friendship Tracker in Python, TypeScript, JavaScript, Go, Java, Rust, C#, C++, PHP, Ruby, Kotlin, Swift, Dart, Elixir, and Clojure.

Each library is a single source file you download from this page and drop into your project. Most languages need nothing else - the file uses only the standard library. Rust is the one exception: add the two crates listed in the file header (reqwest + serde_json) to your Cargo.toml and you're done. Every endpoint the Friendship Tracker HTTP API exposes is wrapped as a typed function named after the data model and operation, so the surface mirrors the REST API one-to-one. Authentication uses the same personal access tokens the rest of the API accepts. The libraries are easy to vendor, audit, and extend directly in your own codebase.

Download

Pick your language and download the single source file. Module name for Friendship Tracker: friendship_client. Class name for languages with an explicit wrapper type: FriendshipClient.

Version: 0.3.13·Module: friendship_client·Models: 11
Per-language vendoring tips
  • PythonDrop friendship_client.py into your package; from friendship_client import .... Pure stdlib (urllib.request / json / threading); requires Python 3.8+.
  • TypeScriptDrop friendship_client.ts next to your other TS files. Type-checks under any combination of @types/node + DOM lib via small built-in shims; runtime uses fetch (Node 18+ / browser).
  • GoPlace friendship_client.go inside a directory named friendship_client/ so the file's package friendship_client declaration matches its import path.
  • JavaPlace FriendshipClient.java inside a directory named friendship_client/ matching the file's package friendship_client; declaration. Targets JDK 11+; uses java.net.http only.
  • RustAdd the file as a module (mod friendship_client; in your lib.rs or main.rs) and add the two crates listed in the file header (reqwest with the blocking,json features, plus serde_json) to your Cargo.toml.
  • C# / .NETPlace FriendshipClient.cs in any folder; the file declares namespace friendship_client;. Targets .NET 6+; uses HttpClient + System.Text.Json only - no NuGet packages.
  • PHPrequire_once __DIR__ . '/friendship_client.php' from your bootstrap, or autoload the namespace friendship_client\\ via Composer's PSR-4. Requires PHP 8.0+ with the curl and json extensions (both default).
  • Rubyrequire_relative 'friendship_client' from anywhere in your project. The wrapper class is FriendshipClient::Client. Targets Ruby 3.0+; pure stdlib (net/http, json, securerandom).
  • KotlinPlace FriendshipClient.kt inside a directory named friendship_client/ matching the file's package friendship_client declaration. Targets Kotlin 1.9+ on JVM 11+; pure JDK only.
  • SwiftDrop FriendshipClient.swift next to your other Swift files. Targets Swift 5.7+ (macOS 12 / iOS 15 / Linux with FoundationNetworking).

Authenticate

Create a personal access token (PAT) from the Integrations menu and pass it to the library at runtime. Every language exposes the same two configuration knobs: an explicit setToken(...) call, or the XCLIENT_TOKEN environment variable for CI / scripted use. Tokens are sent as Authorization: Bearer ... on every request and the library never logs them.

from friendship_client import set_token
set_token("pat_…")
# or, equivalently:
# export XCLIENT_TOKEN=pat_…

Use the library

Save the downloaded file under your project as friendship_client.py (or the equivalent for your language) and import the operation functions you need. Each function is named <model>_<op> (account_create, deal_list, lead_get, ...) and forwards to the matching HTTP endpoint with retry-on-429, exponential backoff, and Retry-After honoured automatically. List functions accept the standard query parameters (limit, offset, sort, q, plus the type's allowed filters); get/update/delete functions accept the row id as their first argument.

from friendship_client import activity_list, activity_get, activity_create, activity_update, activity_delete
# List the first 20 rows
page = activity_list(limit=20, sort="-created_at")
print(page["data"], page["meta"]["has_more"])
# Create + read + update + delete
created = activity_create({"name": "Example"})
fresh = activity_get(created["id"])
activity_update(created["id"], {"name": "Updated"})
activity_delete(created["id"])

Available models

Each library exposes one function per operation per model. The list below is the one-to-one mirror of the HTTP endpoints this app exposes.

ModelFunctions
activity
activity_listactivity_getactivity_createactivity_updateactivity_delete
contact
contact_listcontact_getcontact_createcontact_updatecontact_delete
conversation
conversation_listconversation_getconversation_createconversation_updateconversation_delete
custom_field
custom_field_listcustom_field_getcustom_field_createcustom_field_updatecustom_field_delete
gift
gift_listgift_getgift_creategift_updategift_delete
journal_entry
journal_entry_listjournal_entry_getjournal_entry_createjournal_entry_updatejournal_entry_delete
life_event
life_event_listlife_event_getlife_event_createlife_event_updatelife_event_delete
note
note_listnote_getnote_createnote_updatenote_delete
pet
pet_listpet_getpet_createpet_updatepet_delete
relationship
relationship_listrelationship_getrelationship_createrelationship_updaterelationship_delete
reminder
reminder_listreminder_getreminder_createreminder_updatereminder_delete

Environment variables

VariablePurpose
XCLIENT_TOKENPersonal access token used for every API call.
XCLIENT_BASE_URLOverride the baked-in server URL (testing only).

Analytics + updates

Each call sends one analytics event to the same dashboard as the web UI (operation name, library version, OS - no field values, no request bodies) so the team running this app can see how the integration is used. The data is processed securely; an audit log of every event tied to you can be requested at any time from the company operating the app. Separately, the library checks for a newer version once every 24 hours. In interpreted languages (Python, TypeScript on Node, JavaScript on Node, PHP, Ruby, Elixir) the on-disk file is replaced atomically and the next import picks up the new bytes. In compiled languages (Go, Java, Rust, C#, C++, Kotlin, Swift, Dart, Clojure) the source file is left as-is - users ship pre-compiled artefacts, so the version probe just stamps a timestamp you can surface at build-time. Set XCLIENT_NO_AUTOUPDATE=1 to disable the probe entirely.