@grata-labs/ts-limitless
v0.1.0
Published
TypeScript SDK for the Limitless API
Maintainers
Readme
ts-limitless
TypeScript client library for interacting with the Limitless API
Installation
npm install @grata-labs/ts-limitlessQuick Start
import { Limitless } from '@grata-labs/ts-limitless';
// Initialize the client
const client = new Limitless('your-api-key');
// Get recent lifelogs
const lifelogs = await client.getLifelogs({ limit: 10 });
console.log(lifelogs.data?.lifelogs);
// Search lifelogs
const searchResults = await client.searchLifelogs('meeting');
// Get specific lifelog
const lifelog = await client.getLifelog('lifelog-id');Configuration
// Simple initialization
const client = new Limitless('your-api-key');
// With configuration options
const client = new Limitless({
apiKey: 'your-api-key',
baseUrl: 'https://api.limitless.ai',
timeout: 30000
});API Methods
Lifelogs
getLifelogs(params?)- Get recent lifelogs with optional filteringgetLifelog(id, params?)- Get a specific lifelog by IDdeleteLifelog(id)- Delete a lifelogsearchLifelogs(query, params?)- Search lifelogsgetLifelogsByDate(date, timezone?)- Get lifelogs for a specific dategetStarredLifelogs(params?)- Get starred lifelogs
Chats
listChats(params?)- Get recent chatsgetChat(id, params?)- Get a specific chat by IDdeleteChat(id)- Delete a chat
Audio
getAudio(params)- Download audio for a time range
Pagination
// Manual pagination
const firstPage = await client.getLifelogs({ limit: 10 });
if (firstPage.meta?.lifelogs?.nextCursor) {
const nextPage = await client.getLifelogs({
limit: 10,
cursor: firstPage.meta.lifelogs.nextCursor
});
}Error Handling
try {
const lifelogs = await client.getLifelogs();
} catch (error) {
console.error('Failed to fetch lifelogs:', error.message);
}Requirements
- Node.js 18 or higher
- Valid Limitless API key (Get one here)
Development
This library is built from the official Limitless OpenAPI specification:
- The
openapi.ymlis taken directly from limitless.ai - It's converted to OpenAPI v3 format:
npm run convert-openapi - TypeScript definitions are generated:
npm run generate-types - The client is built:
npm run build
Building from source
# Clone the repository
git clone https://github.com/grata-labs/ts-limitless.git
cd ts-limitless
# Install dependencies
npm install
# Generate types and build
npm run buildLicense
MIT © Grata Labs, LLC
