Documentation · beta

SDK: TypeScript and Node

The SDK is TypeScript first and runs in Node, Next.js, Astro, SvelteKit and Remix server code. It is closed source and licensed to Developer Network members; the package is published to a members-only registry you get access to on approval.

Install

npm i @presenceplus/sdk

Use

import { PresenceClient } from "@presenceplus/sdk";

const presence = new PresenceClient({ token: session.accessToken }); // the person's token from Sign in with Presence+

// Who is this person, and which communities are they in?
const me = await presence.me();

// Their companions: who walks with whom, with consent already checked
const edges = await presence.people.edges(me.sub, { kind: "walks_with" });

// Record an outcome measure for a session (PCOMS, under license)
await presence.measures.record({ person: me.sub, scale: "ORS", score: 28 });

Other languages

Python, Ruby, PHP, Laravel, Elixir, Go, Flutter and WordPress are planned. The REST API works from all of them today; see the API reference.

Placeholder: the method names above show the shape of the SDK and will be replaced with the generated reference when the package ships to members.