Reference an entity.
const entityLink = {
entity: "alice.baq.run",
};
EntityLink
new(entity: Entity)
: EntityLink
Once created, an entity link can be used in the content of a record. In this example we create a Post record that mentions other users with the help of entity links.
import {EntityLink} from "@baqhub/sdk";
import {PostRecord} from "./baq/postRecord.js";
const entityLink1 = EntityLink.new("henry.baq.run");
const entityLink2 = EntityLink.new("sean.baq.run");
const postRecord = PostRecord.new("paul.baq.run", {
text: "Where are you going this weekend? @henry.baq.run @sean.baq.run",
textMentions: [
{mention: entityLink1, index: 34, length: 14},
{mention: entityLink2, index: 49, length: 13},
],
});