Target Environment:
This simulates the parent application authenticating with the shared backend.
Test Deep Linking:
Test Headless SDK (Current Creation Model):
Creates a task with normalized tags, structured sharing refs, and optional `#note` linkage, then verifies the task is anchored by personal-context refs instead of the legacy direct user link.
Creates a canonical-key note and can fully link tasks into the note workspace the new way.
Calls the SDK's direct note-link helper so you can test current workspace linking without creating a new note.
Manual Auth:
1. Available Routes:
/embed/notes: Renders the full notepad/editor./embed/notes?noteId=XXX: Renders a specific note directly./embed/quick-add: Renders a standalone task creation form.2. Programmatic Creation (TasGrid SDK):
The recommended way to create entries is using the tasgrid-sdk.js module. This
now applies TasGrid's current normalized creation rules, including canonical note keys,
structured labelTags/shareRefs/noteRefs, owner-context
tagging, and note-linked task metadata.
Setup:
import { createTasgridTask, createTasgridNote } from 'https://tasgrid.ccllc.pro/tasgrid-sdk.js';
A. Creating a TASK:
Use this for items that need status, priority, and automated due date calculation.
const task = await createTasgridTask(pb, {
title: "Urgent Task",
urgency: 10, // Automated: 10=Today, 5=Next Week, 1=Six Months
priority: 8, // 1-10
size: 3, // Default: 3 (1 hour). Range 0-10.
tags: ["external", "@Shared Bucket", "#project-brief"],
shareModeByTag: {
"@shared bucket": "handoff",
"#project-brief": "collaborative"
},
owner: "USER_ID" // Optional: target personal-context owner, not a direct task.user link
});
B. Creating a NOTE:
Use this for long-form content or documentation without a deadline.
const note = await createTasgridNote(pb, {
title: "Project Brief",
content: "<p>HTML content here...</p>",
tags: ["documentation"],
noteShareMode: "collaborative",
isPrivate: false,
tasks: [] // Optional: Task IDs to store and fully link into the note workspace
});
3. Authentication Protocol:
The parent application must send a postMessage to the iframe immediately after the
iframe loads (or whenever auth state changes). Since iframes reset their internal state on
navigation,
you should always sync auth on the onload event.
Example using vanilla JS:
// 1. Define sync function
function syncAuth(iframe) {
iframe.contentWindow.postMessage({
type: "TASGRID_AUTH",
token: pb.authStore.token,
user: pb.authStore.model
}, "*");
}
// 2. Attach to iframe (either in HTML or via JS)
// <iframe onload="syncAuth(this)" src="..."></iframe>
4. Responsiveness:
Both routes are designed to be fluid. Ensure your iframe container has defined dimensions; the content will expand to fill it.
/embed/notes
/embed/quick-add