Skip to main content
Use contact() to share contact cards. The builder takes either a structured ContactInput, a vCard string, a vcf instance, or a known User paired with optional ContactDetails.
import { contact } from "spectrum-ts";

await space.send(contact({
  name: { first: "Ada", last: "Lovelace" },
  phones: [{ value: "+15551234567", type: "mobile" }],
  emails: [{ value: "ada@example.com", type: "work" }],
}));
fromVCard(vcf) parses a vCard string into a ContactInput. toVCard(contact) serializes a resolved Contact back to vCard.
FieldTypeDescription
name{ formatted?, first?, last?, middle?, prefix?, suffix? }Structured display name.
phonesArray<{ value, type? }>Phone numbers. type is "mobile" | "home" | "work" | "other".
emailsArray<{ value, type? }>Email addresses. type is "home" | "work" | "other".
addressesArray<{ street?, city?, region?, postalCode?, country?, type? }>Postal addresses.
org{ name?, title?, department? }Employer or org info.
urlsstring[]Associated URLs.
birthdaystringISO date.
notestringFree-form note.
photo{ mimeType, read() }Profile photo bytes.
rawunknownProvider-specific extras passed through untouched.