Thank you for being patient! We're working hard on resolving the issue
The Lona SDK lets you programmatically access your sheets, rows, events, calendars, and tasks. Available for JavaScript and TypeScript.
Generate a personal access token at lona.so/settings/tokens, then set it as an environment variable:
export LONA_ACCESS_TOKEN="lona_pat_..."
The token grants the same access as your user account. Do not commit it to version control. See Authentication for details.
Create a client and open a sheet:
import { LonaSdk, SheetPlatform } from "@tento-lona";
const client = new LonaSdk.Client({
accessToken: process.env.LONA_ACCESS_TOKEN,
storage: localStorage,
platform: SheetPlatform.TEST,
});
// List all sheets
const sheets = await client.sheets.list();
console.log(`Found ${sheets.length} sheets`);
// Open the first sheet
const handle = await client.open(sheets[0].id.toString());
console.log(`Sheet: ${handle.title}`);
// Print the row tree
const tree = handle.tree();
console.log(tree.print(node => {
const row = handle.row(node.id.toString());
return `${row?.label ?? "(no label)"} [${row?.type}]`;
}));
for (const row of handle.rows.list) {
console.log(`${row.label ?? "(no label)"} — ${row.type}`);
if (row.lookupKey) console.log(` lookupKey: ${row.lookupKey}`);
}
LonaSdk.Client works