πExample Workflow
Example workflow to start creating and updating your Documents with Context Protocol.
1. Create a Document
import { Context } from '@contextprotocol/sdk';
const ctx = new Context({ apiKey: 'your_api_key_here' });
async function createDocument() {
const data = {
title: "Initial Document",
content: "This is the initial content of the document."
};
const pathToFile = "myfiles/path/file_name";
const document = await ctx.createDocument(pathToFile, data);
if (!document.success) {
// Handle error
}
console.log(`Document created on: ${document.data.path}`);
return document;
}2. Define and create a Template
3. Update the Document
3. Install the Template
Last updated
Was this helpful?