Skip to main content

Built and signed on GitHub Actions

An ActivityPub/fediverse server framework

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
a week ago (1.3.0)
function lookupObject
lookupObject(
identifier: string | URL,
): Promise<Object | null>

Looks up an ActivityStreams object by its URI (including acct: URIs) or a fediverse handle (e.g., @user@server or user@server).

Examples

Example 1

// Look up an actor by its fediverse handle:
await lookupObject("@hongminhee@fosstodon.org");
// returning a `Person` object.

// A fediverse handle can omit the leading '@':
await lookupObject("hongminhee@fosstodon.org");
// returning a `Person` object.

// A `acct:` URI can be used as well:
await lookupObject("acct:hongminhee@fosstodon.org");
// returning a `Person` object.

// Look up an object by its URI:
await lookupObject("https://todon.eu/@hongminhee/112060633798771581");
// returning a `Note` object.

// It can be a `URL` object as well:
await lookupObject(new URL("https://todon.eu/@hongminhee/112060633798771581"));
// returning a `Note` object.

Parameters

identifier: string | URL

The URI or fediverse handle to look up.

optional
options: LookupObjectOptions

Lookup options.

Return Type

Promise<Object | null>

The object, or null if not found.

Add Package

deno add jsr:@fedify/fedify

Import symbol

import { lookupObject } from "@fedify/fedify";

---- OR ----

Import directly with a jsr specifier

import { lookupObject } from "jsr:@fedify/fedify";

Add Package

npx jsr add @fedify/fedify

Import symbol

import { lookupObject } from "@fedify/fedify";

Add Package

yarn dlx jsr add @fedify/fedify

Import symbol

import { lookupObject } from "@fedify/fedify";

Add Package

pnpm dlx jsr add @fedify/fedify

Import symbol

import { lookupObject } from "@fedify/fedify";

Add Package

bunx jsr add @fedify/fedify

Import symbol

import { lookupObject } from "@fedify/fedify";