@paragraph-com/sdk
TypeScript SDK for the Paragraph API. Used to interact with Paragraph posts, users, coins, & more.
Install
yarn add @paragraph-com/sdk
Quick start
import { ParagraphAPI } from "@paragraph-com/sdk";
const api = new ParagraphAPI();
const post = await api.posts.get({ id: "postId" });
const apiWithAuth = new ParagraphAPI({ apiKey: "your-api-key" });
const newPost = await apiWithAuth.posts.create({
title: "My Post",
markdown: "# Hello World",
});
Authenticated endpoints
Several endpoints require an API key, which identifies your publication. Pass it when creating the client:
const api = new ParagraphAPI({ apiKey: "your-api-key" });
const publication = await api.me.get();
const { items: drafts } = await api.posts.list({ status: "draft" });
await api.posts.update({
id: "postId",
title: "Updated Title",
markdown: "## New content",
status: "published",
});
await api.posts.delete({ id: "postId" });
Documentation
See the API reference for detailed documentation & a playground.
See autogenerated TypeScript docs for all available methods.