Skip to main content

@idiomark/adapter-notion

Notion adapter for Idiomark (Personality Compute Protocol) extraction.

Features​

  • User Profile: Basic user information
  • Pages: All pages with titles and content
  • Databases: Structured data collections
  • Page Content: Full page content including text, headings, lists, todos, code blocks
  • Database Items: Items stored in databases (journaling, notes, etc.)
  • Block Content: Individual content blocks (paragraphs, headings, lists, callouts, quotes, code)

Data Types​

Data TypeDescriptionPersonality Insights
PagesDocuments with titles and contentOrganizational style, topics of interest
Page ContentFull page text and structureWriting style, expression patterns
DatabasesStructured data collectionsOrganizational preferences
Database ItemsIndividual database entriesJournaling habits, note-taking style
BlocksContent blocks (text, lists, todos)Communication style, task management

Authentication​

This adapter uses OAuth2 authentication with Notion API.

import { NotionAdapter } from '@idiomark/adapter-notion'

const adapter = new NotionAdapter({
accessToken: 'your-access-token'
})

Getting Access Tokens​

  1. Create an integration at https://www.notion.so/my-integrations
  2. Get the access token (Internal Integration Token)
  3. Share your pages/databases with the integration

Usage​

// Authenticate and fetch data
await adapter.authenticate()

// Search for pages
const pages = await adapter.searchPages({
limit: 100,
startDate: new Date('2024-01-01'),
endDate: new Date('2024-12-31')
})

// Extract personality-relevant content
const content = await adapter.fetchData({
limit: 100,
includeReplies: true
})

// Get raw text for analysis
const { rawContent, metadata } = await adapter.extractRawText()

Rate Limits​

Notion enforces rate limits:

  • Request limit: 3 requests per second

This adapter implements rate limiting with automatic retries.

Personality Analysis​

The Notion adapter provides insights into:

  • Writing Style: Language patterns, vocabulary, expression
  • Organization: Structure preference (pages vs databases, hierarchies)
  • Task Management: Todo usage, checkbox patterns, task completion
  • Self-Reflection: Journaling frequency, depth of reflection
  • Planning: Goal setting, project planning habits
  • Creativity: Use of different content types, creative expression
  • Note-Taking: Information organization, knowledge management style
  • Interests: Topics and themes in pages and databases

API Coverage​

EndpointAccessData Type
/users/meProfileUser profile
/searchSearchPages and databases
/blocks/{id}/childrenContentPage content blocks
/databases/{id}/queryDatabaseDatabase items

Content Types Supported​

The adapter extracts text from:

  • Text Blocks: Paragraphs and plain text
  • Headings: H1, H2, H3 headers (hierarchical structure)
  • Lists: Bulleted and numbered lists
  • Todos: Checkbox items (task tracking)
  • Quotes: Block quotes
  • Callouts: Highlighted callout boxes
  • Code: Code blocks with language tags
  • Toggles: Collapsible content sections
  • Dividers: Page separators

Limitations​

  • Only accesses content shared with the integration
  • Integration must be explicitly granted access to pages/databases
  • Private pages not shared with integration won't be accessible
  • Rate limiting requires careful usage for large workspaces
  • Complex nested content may require multiple API calls

License​

MIT