Getting Started with the Semble PDS Client
We'll be shipping a more comprehensive API in the future. Meanwhile, this is a simple and lightweight PDS client for creating, updating, and deleting Semble records directly on your PDS. Please share any feedback about bugs or ways to improve it (or feel free to make a PR directly to the package).
Also, you don’t have to use our PDS client. You are free to interact with Semble data in your PDS however you like. For example, changes made directly in pdsls.dev will still reflect in Semble. If you make your own PDS clients for Semble data, we’d love to know about it, too!
Installation
npm install @cosmik.network/semble-pds-clientYou can view the npm package here.
Usage
import { SemblePDSClient } from '@cosmik.network/semble-pds-client';
const client = new SemblePDSClient({
service: '<https://bsky.social>', // or your PDS URL
});
// Login with app password
await client.login('your-handle.bsky.social', 'your-app-password');
// Create a URL card
const card = await client.createCard({
url: '<https://example.com>',
note: 'Optional note about this URL',
});
// Add a note to an existing card
const noteCard = await client.addNoteToCard(card, 'This is my note');
// Create a collection
const collection = await client.createCollection({
name: 'My Collection',
description: 'Optional description',
});
// Add card to collection
const collectionLink = await client.addCardToCollection(card, collection);
// Update a note
await client.updateNote(noteCard, 'Updated note text');
// Delete a card
await client.deleteCard(card);
// Update collection
await client.updateCollection(collection, 'New Name', 'New description');
// Delete collection
await client.deleteCollection(collection);
// Remove card from collection
await client.removeCardFromCollection(collectionLink);Last updated

