[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F6H8YZBFQB4R0JHFNMBX97":3,"skill-same:01M6F6H8YZBFQB4R0JHFNMBX97":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M6F6H8YZBFQB4R0JHFNMBX97","evernote-webhooks-events",null,"Implement Evernote webhook notifications and sync events.\nUse when handling note changes, implementing real-time sync,\nor processing Evernote notifications.\nTrigger with phrases like \"evernote webhook\", \"evernote events\",\n\"evernote sync\", \"evernote notifications\".","Dicklesworthstone\u002Fpi_agent_rust","Dicklesworthstone","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F35050222?v=4","01M6CG26AR942CSVMN1M5E3DSE","Jeff Emanuel","01M6CG26EPP71PSHW1VDS71121",1992,"MIT","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fevernote-pack\u002Fskills\u002Fevernote-webhooks-events\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"evernote","evernote webhooks events","events","webhooks","webhook","when","changes","implementing","with","note","processing","trigger","io","implement","time","use","edit","write","read","curl","Bash","real-time","notifications","sync","2026-11-10 10:12:30",false,"---\nname: evernote-webhooks-events\ndescription: |\n  Implement Evernote webhook notifications and sync events.\n  Use when handling note changes, implementing real-time sync,\n  or processing Evernote notifications.\n  Trigger with phrases like \"evernote webhook\", \"evernote events\",\n  \"evernote sync\", \"evernote notifications\".\nallowed-tools: Read, Write, Edit, Bash(curl:*)\nversion: 1.0.0\nlicense: MIT\nauthor: Jeremy Longshore \u003Cjeremy@intentsolutions.io>\n---\n\n# Evernote Webhooks & Events\n\n## Overview\n\nImplement Evernote webhook notifications for real-time change detection. Note: Evernote webhooks notify you that changes occurred, but you must use the sync API to retrieve actual changes.\n\n## Prerequisites\n\n- Evernote API key with webhook permissions\n- HTTPS endpoint accessible from internet\n- Understanding of Evernote sync API\n\n## How Evernote Webhooks Work\n\nUnlike most APIs, Evernote webhooks only notify that a user's account changed. They do NOT include the actual changes in the payload. You must:\n\n1. Receive webhook notification\n2. Use sync API to fetch actual changes\n3. Process the retrieved changes\n\n## Instructions\n\n### Step 1: Webhook Endpoint\n\n```javascript\n\u002F\u002F routes\u002Fwebhooks.js\nconst express = require('express');\nconst crypto = require('crypto');\nconst router = express.Router();\n\n\u002F\u002F Evernote webhook endpoint\nrouter.get('\u002Fwebhooks\u002Fevernote', (req, res) => {\n  \u002F\u002F Evernote sends GET requests for webhooks\n  const {\n    userId,      \u002F\u002F Evernote user ID\n    guid,        \u002F\u002F GUID of changed note (if applicable)\n    notebookGuid,\u002F\u002F GUID of changed notebook (if applicable)\n    reason       \u002F\u002F Reason for notification\n  } = req.query;\n\n  console.log('Webhook received:', {\n    userId,\n    guid,\n    notebookGuid,\n    reason,\n    timestamp: new Date().toISOString()\n  });\n\n  \u002F\u002F Acknowledge receipt immediately\n  res.status(200).send('OK');\n\n  \u002F\u002F Process asynchronously\n  processWebhook(userId, guid, notebookGuid, reason)\n    .catch(err => console.error('Webhook processing error:', err));\n});\n\nasync function processWebhook(userId, guid, notebookGuid, reason) {\n  \u002F\u002F Queue the sync job\n  await syncQueue.add('sync-user', {\n    userId,\n    guid,\n    notebookGuid,\n    reason,\n    receivedAt: Date.now()\n  });\n}\n\nmodule.exports = router;\n```\n\n### Step 2: Webhook Reasons\n\n```javascript\n\u002F\u002F Evernote webhook reasons\nconst WebhookReasons = {\n  CREATE: 'create',    \u002F\u002F New note created\n  UPDATE: 'update',    \u002F\u002F Note updated\n  \u002F\u002F Note: No DELETE reason - must detect via sync\n};\n\n\u002F\u002F Handle different webhook types\nasync function handleWebhookByReason(userId, guid, reason) {\n  switch (reason) {\n    case WebhookReasons.CREATE:\n      await handleNoteCreated(userId, guid);\n      break;\n\n    case WebhookReasons.UPDATE:\n      await handleNoteUpdated(userId, guid);\n      break;\n\n    default:\n      \u002F\u002F Unknown reason - perform full sync check\n      await performIncrementalSync(userId);\n  }\n}\n```\n\n### Step 3: Sync State Management\n\n```javascript\n\u002F\u002F services\u002Fsync-service.js\nconst Evernote = require('evernote');\n\nclass SyncService {\n  constructor(noteStore) {\n    this.noteStore = noteStore;\n    this.lastUpdateCount = 0;\n  }\n\n  \u002F**\n   * Get current sync state\n   *\u002F\n  async getSyncState() {\n    return this.noteStore.getSyncState();\n  }\n\n  \u002F**\n   * Check if sync is needed\n   *\u002F\n  async needsSync(lastKnownUpdateCount) {\n    const state = await this.getSyncState();\n    return state.updateCount > lastKnownUpdateCount;\n  }\n\n  \u002F**\n   * Perform incremental sync\n   *\u002F\n  async incrementalSync(afterUpdateCount) {\n    const chunks = [];\n    let currentUpdateCount = afterUpdateCount;\n\n    while (true) {\n      \u002F\u002F Get sync chunk\n      const chunk = await this.noteStore.getFilteredSyncChunk(\n        currentUpdateCount,\n        100, \u002F\u002F Max entries per chunk\n        {\n          includeNotes: true,\n          includeNotebooks: true,\n          includeTags: true,\n          includeExpunged: true  \u002F\u002F Detect deletions\n        }\n      );\n\n      chunks.push(chunk);\n\n      \u002F\u002F Check if more chunks\n      if (chunk.chunkHighUSN >= chunk.updateCount) {\n        break;\n      }\n\n      currentUpdateCount = chunk.chunkHighUSN;\n    }\n\n    return this.processChunks(chunks);\n  }\n\n  \u002F**\n   * Process sync chunks\n   *\u002F\n  processChunks(chunks) {\n    const changes = {\n      notes: { created: [], updated: [], deleted: [] },\n      notebooks: { created: [], updated: [], deleted: [] },\n      tags: { created: [], updated: [], deleted: [] }\n    };\n\n    for (const chunk of chunks) {\n      \u002F\u002F Process notes\n      if (chunk.notes) {\n        for (const note of chunk.notes) {\n          if (note.deleted) {\n            changes.notes.deleted.push(note.guid);\n          } else if (note.created === note.updated) {\n            changes.notes.created.push(note);\n          } else {\n            changes.notes.updated.push(note);\n          }\n        }\n      }\n\n      \u002F\u002F Process expunged (permanently deleted)\n      if (chunk.expungedNotes) {\n        changes.notes.deleted.push(...chunk.expungedNotes);\n      }\n\n      \u002F\u002F Process notebooks\n      if (chunk.notebooks) {\n        for (const notebook of chunk.notebooks) {\n          changes.notebooks.updated.push(notebook);\n        }\n      }\n\n      if (chunk.expungedNotebooks) {\n        changes.notebooks.deleted.push(...chunk.expungedNotebooks);\n      }\n\n      \u002F\u002F Process tags\n      if (chunk.tags) {\n        for (const tag of chunk.tags) {\n          changes.tags.updated.push(tag);\n        }\n      }\n\n      if (chunk.expungedTags) {\n        changes.tags.deleted.push(...chunk.expungedTags);\n      }\n    }\n\n    return changes;\n  }\n}\n\nmodule.exports = SyncService;\n```\n\n### Step 4: Webhook Event Processing\n\n```javascript\n\u002F\u002F services\u002Fevent-processor.js\nconst EventEmitter = require('events');\n\nclass EvernoteEventProcessor extends EventEmitter {\n  constructor(syncService, options = {}) {\n    super();\n    this.syncService = syncService;\n    this.processingLock = new Map();\n    this.debounceMs = options.debounceMs || 5000;\n    this.pendingWebhooks = new Map();\n  }\n\n  \u002F**\n   * Handle incoming webhook (debounced)\n   *\u002F\n  async handleWebhook(userId, guid, reason) {\n    const key = `${userId}`;\n\n    \u002F\u002F Debounce multiple webhooks for same user\n    if (this.pendingWebhooks.has(key)) {\n      clearTimeout(this.pendingWebhooks.get(key));\n    }\n\n    this.pendingWebhooks.set(key, setTimeout(async () => {\n      this.pendingWebhooks.delete(key);\n      await this.processUserChanges(userId);\n    }, this.debounceMs));\n  }\n\n  \u002F**\n   * Process changes for a user\n   *\u002F\n  async processUserChanges(userId) {\n    \u002F\u002F Prevent concurrent processing\n    if (this.processingLock.has(userId)) {\n      console.log(`Already processing for user ${userId}`);\n      return;\n    }\n\n    this.processingLock.set(userId, true);\n\n    try {\n      \u002F\u002F Get last known update count\n      const lastUpdateCount = await this.getStoredUpdateCount(userId);\n\n      \u002F\u002F Check if sync needed\n      if (!await this.syncService.needsSync(lastUpdateCount)) {\n        console.log(`No changes for user ${userId}`);\n        return;\n      }\n\n      \u002F\u002F Perform incremental sync\n      const changes = await this.syncService.incrementalSync(lastUpdateCount);\n\n      \u002F\u002F Emit events for changes\n      this.emitChangeEvents(userId, changes);\n\n      \u002F\u002F Store new update count\n      const state = await this.syncService.getSyncState();\n      await this.storeUpdateCount(userId, state.updateCount);\n\n    } finally {\n      this.processingLock.delete(userId);\n    }\n  }\n\n  \u002F**\n   * Emit events for detected changes\n   *\u002F\n  emitChangeEvents(userId, changes) {\n    \u002F\u002F Note events\n    for (const note of changes.notes.created) {\n      this.emit('note:created', { userId, note });\n    }\n\n    for (const note of changes.notes.updated) {\n      this.emit('note:updated', { userId, note });\n    }\n\n    for (const guid of changes.notes.deleted) {\n      this.emit('note:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Notebook events\n    for (const notebook of changes.notebooks.updated) {\n      this.emit('notebook:updated', { userId, notebook });\n    }\n\n    for (const guid of changes.notebooks.deleted) {\n      this.emit('notebook:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Tag events\n    for (const tag of changes.tags.updated) {\n      this.emit('tag:updated', { userId, tag });\n    }\n\n    for (const guid of changes.tags.deleted) {\n      this.emit('tag:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Summary event\n    this.emit('sync:complete', {\n      userId,\n      summary: {\n        notesCreated: changes.notes.created.length,\n        notesUpdated: changes.notes.updated.length,\n        notesDeleted: changes.notes.deleted.length\n      }\n    });\n  }\n\n  \u002F\u002F Storage methods (implement with your database)\n  async getStoredUpdateCount(userId) {\n    \u002F\u002F Return stored update count for user\n    return 0; \u002F\u002F Default to 0 for initial sync\n  }\n\n  async storeUpdateCount(userId, updateCount) {\n    \u002F\u002F Store update count for user\n  }\n}\n\nmodule.exports = EvernoteEventProcessor;\n```\n\n### Step 5: Event Handlers\n\n```javascript\n\u002F\u002F handlers\u002Fevent-handlers.js\nconst processor = require('.\u002Fevent-processor');\n\n\u002F\u002F Handle new notes\nprocessor.on('note:created', async ({ userId, note }) => {\n  console.log(`New note created: ${note.title}`);\n\n  \u002F\u002F Example: Index for search\n  await searchIndex.indexNote(note);\n\n  \u002F\u002F Example: Send notification\n  await notifications.send(userId, {\n    type: 'note_created',\n    title: note.title\n  });\n});\n\n\u002F\u002F Handle note updates\nprocessor.on('note:updated', async ({ userId, note }) => {\n  console.log(`Note updated: ${note.title}`);\n\n  \u002F\u002F Example: Update search index\n  await searchIndex.updateNote(note);\n\n  \u002F\u002F Example: Sync to external service\n  await externalSync.updateNote(userId, note);\n});\n\n\u002F\u002F Handle note deletions\nprocessor.on('note:deleted', async ({ userId, guid }) => {\n  console.log(`Note deleted: ${guid}`);\n\n  \u002F\u002F Example: Remove from search index\n  await searchIndex.removeNote(guid);\n\n  \u002F\u002F Example: Clean up related data\n  await database.cleanupNoteData(guid);\n});\n\n\u002F\u002F Handle sync completion\nprocessor.on('sync:complete', ({ userId, summary }) => {\n  console.log(`Sync complete for user ${userId}:`, summary);\n\n  \u002F\u002F Example: Log metrics\n  metrics.recordSync({\n    userId,\n    ...summary\n  });\n});\n```\n\n### Step 6: Webhook Registration\n\n```javascript\n\u002F\u002F Note: Webhook registration is done through Evernote Developer Portal\n\u002F\u002F API key settings, not through the API itself.\n\n\u002F\u002F Webhook configuration in Evernote Developer Portal:\n\u002F\u002F 1. Go to https:\u002F\u002Fdev.evernote.com\u002F\n\u002F\u002F 2. Navigate to your API key settings\n\u002F\u002F 3. Enable webhooks\n\u002F\u002F 4. Set webhook URL: https:\u002F\u002Fyour-domain.com\u002Fwebhooks\u002Fevernote\n\n\u002F\u002F For local development, use ngrok:\n\u002F\u002F ngrok http 3000\n\u002F\u002F Then update webhook URL temporarily in developer portal\n```\n\n### Step 7: Polling Fallback\n\n```javascript\n\u002F\u002F services\u002Fpolling-service.js\n\n\u002F**\n * Fallback polling for when webhooks aren't available\n * or as a backup sync mechanism\n *\u002F\nclass PollingService {\n  constructor(syncService, options = {}) {\n    this.syncService = syncService;\n    this.pollInterval = options.pollInterval || 5 * 60 * 1000; \u002F\u002F 5 minutes\n    this.users = new Map(); \u002F\u002F userId -> lastUpdateCount\n    this.timer = null;\n  }\n\n  \u002F**\n   * Start polling for a user\n   *\u002F\n  addUser(userId, accessToken) {\n    this.users.set(userId, {\n      accessToken,\n      lastUpdateCount: 0\n    });\n  }\n\n  \u002F**\n   * Remove user from polling\n   *\u002F\n  removeUser(userId) {\n    this.users.delete(userId);\n  }\n\n  \u002F**\n   * Start polling loop\n   *\u002F\n  start() {\n    if (this.timer) return;\n\n    this.timer = setInterval(async () => {\n      await this.pollAllUsers();\n    }, this.pollInterval);\n\n    console.log(`Polling started (interval: ${this.pollInterval}ms)`);\n  }\n\n  \u002F**\n   * Stop polling\n   *\u002F\n  stop() {\n    if (this.timer) {\n      clearInterval(this.timer);\n      this.timer = null;\n    }\n  }\n\n  \u002F**\n   * Poll all registered users\n   *\u002F\n  async pollAllUsers() {\n    for (const [userId, data] of this.users) {\n      try {\n        await this.pollUser(userId, data);\n      } catch (error) {\n        console.error(`Poll failed for user ${userId}:`, error.message);\n      }\n    }\n  }\n\n  \u002F**\n   * Poll single user for changes\n   *\u002F\n  async pollUser(userId, data) {\n    const state = await this.syncService.getSyncState();\n\n    if (state.updateCount > data.lastUpdateCount) {\n      console.log(`Changes detected for user ${userId}`);\n\n      const changes = await this.syncService.incrementalSync(\n        data.lastUpdateCount\n      );\n\n      \u002F\u002F Update stored count\n      data.lastUpdateCount = state.updateCount;\n\n      \u002F\u002F Process changes\n      await this.processChanges(userId, changes);\n    }\n  }\n\n  async processChanges(userId, changes) {\n    \u002F\u002F Same processing as webhook handler\n  }\n}\n\nmodule.exports = PollingService;\n```\n\n## Output\n\n- Webhook endpoint implementation\n- Sync state management\n- Event-driven change processing\n- Event handlers for note lifecycle\n- Polling fallback mechanism\n\n## Webhook vs Polling\n\n| Aspect | Webhooks | Polling |\n|--------|----------|---------|\n| Latency | Near real-time | Poll interval |\n| Rate limit impact | None | Uses API quota |\n| Reliability | Depends on network | Consistent |\n| Setup complexity | Requires public URL | Simple |\n| Recommended | Production | Development\u002Fbackup |\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Webhook not received | URL not reachable | Verify HTTPS endpoint |\n| Duplicate webhooks | Network retries | Implement idempotency |\n| Missing changes | Race condition | Re-sync after timeout |\n| Sync timeout | Large change set | Increase chunk size |\n\n## Resources\n\n- [Webhooks Overview](https:\u002F\u002Fdev.evernote.com\u002Fdoc\u002Farticles\u002Fwebhooks.php)\n- [Synchronization](https:\u002F\u002Fdev.evernote.com\u002Fdoc\u002Farticles\u002Fsynchronization.php)\n- [Developer Portal](https:\u002F\u002Fdev.evernote.com\u002F)\n\n## Next Steps\n\nFor performance optimization, see `evernote-performance-tuning`.\n","# Evernote Webhooks & Events\n\n## Overview\n\nImplement Evernote webhook notifications for real-time change detection. Note: Evernote webhooks notify you that changes occurred, but you must use the sync API to retrieve actual changes.\n\n## Prerequisites\n\n- Evernote API key with webhook permissions\n- HTTPS endpoint accessible from internet\n- Understanding of Evernote sync API\n\n## How Evernote Webhooks Work\n\nUnlike most APIs, Evernote webhooks only notify that a user's account changed. They do NOT include the actual changes in the payload. You must:\n\n1. Receive webhook notification\n2. Use sync API to fetch actual changes\n3. Process the retrieved changes\n\n## Instructions\n\n### Step 1: Webhook Endpoint\n\n```javascript\n\u002F\u002F routes\u002Fwebhooks.js\nconst express = require('express');\nconst crypto = require('crypto');\nconst router = express.Router();\n\n\u002F\u002F Evernote webhook endpoint\nrouter.get('\u002Fwebhooks\u002Fevernote', (req, res) => {\n  \u002F\u002F Evernote sends GET requests for webhooks\n  const {\n    userId,      \u002F\u002F Evernote user ID\n    guid,        \u002F\u002F GUID of changed note (if applicable)\n    notebookGuid,\u002F\u002F GUID of changed notebook (if applicable)\n    reason       \u002F\u002F Reason for notification\n  } = req.query;\n\n  console.log('Webhook received:', {\n    userId,\n    guid,\n    notebookGuid,\n    reason,\n    timestamp: new Date().toISOString()\n  });\n\n  \u002F\u002F Acknowledge receipt immediately\n  res.status(200).send('OK');\n\n  \u002F\u002F Process asynchronously\n  processWebhook(userId, guid, notebookGuid, reason)\n    .catch(err => console.error('Webhook processing error:', err));\n});\n\nasync function processWebhook(userId, guid, notebookGuid, reason) {\n  \u002F\u002F Queue the sync job\n  await syncQueue.add('sync-user', {\n    userId,\n    guid,\n    notebookGuid,\n    reason,\n    receivedAt: Date.now()\n  });\n}\n\nmodule.exports = router;\n```\n\n### Step 2: Webhook Reasons\n\n```javascript\n\u002F\u002F Evernote webhook reasons\nconst WebhookReasons = {\n  CREATE: 'create',    \u002F\u002F New note created\n  UPDATE: 'update',    \u002F\u002F Note updated\n  \u002F\u002F Note: No DELETE reason - must detect via sync\n};\n\n\u002F\u002F Handle different webhook types\nasync function handleWebhookByReason(userId, guid, reason) {\n  switch (reason) {\n    case WebhookReasons.CREATE:\n      await handleNoteCreated(userId, guid);\n      break;\n\n    case WebhookReasons.UPDATE:\n      await handleNoteUpdated(userId, guid);\n      break;\n\n    default:\n      \u002F\u002F Unknown reason - perform full sync check\n      await performIncrementalSync(userId);\n  }\n}\n```\n\n### Step 3: Sync State Management\n\n```javascript\n\u002F\u002F services\u002Fsync-service.js\nconst Evernote = require('evernote');\n\nclass SyncService {\n  constructor(noteStore) {\n    this.noteStore = noteStore;\n    this.lastUpdateCount = 0;\n  }\n\n  \u002F**\n   * Get current sync state\n   *\u002F\n  async getSyncState() {\n    return this.noteStore.getSyncState();\n  }\n\n  \u002F**\n   * Check if sync is needed\n   *\u002F\n  async needsSync(lastKnownUpdateCount) {\n    const state = await this.getSyncState();\n    return state.updateCount > lastKnownUpdateCount;\n  }\n\n  \u002F**\n   * Perform incremental sync\n   *\u002F\n  async incrementalSync(afterUpdateCount) {\n    const chunks = [];\n    let currentUpdateCount = afterUpdateCount;\n\n    while (true) {\n      \u002F\u002F Get sync chunk\n      const chunk = await this.noteStore.getFilteredSyncChunk(\n        currentUpdateCount,\n        100, \u002F\u002F Max entries per chunk\n        {\n          includeNotes: true,\n          includeNotebooks: true,\n          includeTags: true,\n          includeExpunged: true  \u002F\u002F Detect deletions\n        }\n      );\n\n      chunks.push(chunk);\n\n      \u002F\u002F Check if more chunks\n      if (chunk.chunkHighUSN >= chunk.updateCount) {\n        break;\n      }\n\n      currentUpdateCount = chunk.chunkHighUSN;\n    }\n\n    return this.processChunks(chunks);\n  }\n\n  \u002F**\n   * Process sync chunks\n   *\u002F\n  processChunks(chunks) {\n    const changes = {\n      notes: { created: [], updated: [], deleted: [] },\n      notebooks: { created: [], updated: [], deleted: [] },\n      tags: { created: [], updated: [], deleted: [] }\n    };\n\n    for (const chunk of chunks) {\n      \u002F\u002F Process notes\n      if (chunk.notes) {\n        for (const note of chunk.notes) {\n          if (note.deleted) {\n            changes.notes.deleted.push(note.guid);\n          } else if (note.created === note.updated) {\n            changes.notes.created.push(note);\n          } else {\n            changes.notes.updated.push(note);\n          }\n        }\n      }\n\n      \u002F\u002F Process expunged (permanently deleted)\n      if (chunk.expungedNotes) {\n        changes.notes.deleted.push(...chunk.expungedNotes);\n      }\n\n      \u002F\u002F Process notebooks\n      if (chunk.notebooks) {\n        for (const notebook of chunk.notebooks) {\n          changes.notebooks.updated.push(notebook);\n        }\n      }\n\n      if (chunk.expungedNotebooks) {\n        changes.notebooks.deleted.push(...chunk.expungedNotebooks);\n      }\n\n      \u002F\u002F Process tags\n      if (chunk.tags) {\n        for (const tag of chunk.tags) {\n          changes.tags.updated.push(tag);\n        }\n      }\n\n      if (chunk.expungedTags) {\n        changes.tags.deleted.push(...chunk.expungedTags);\n      }\n    }\n\n    return changes;\n  }\n}\n\nmodule.exports = SyncService;\n```\n\n### Step 4: Webhook Event Processing\n\n```javascript\n\u002F\u002F services\u002Fevent-processor.js\nconst EventEmitter = require('events');\n\nclass EvernoteEventProcessor extends EventEmitter {\n  constructor(syncService, options = {}) {\n    super();\n    this.syncService = syncService;\n    this.processingLock = new Map();\n    this.debounceMs = options.debounceMs || 5000;\n    this.pendingWebhooks = new Map();\n  }\n\n  \u002F**\n   * Handle incoming webhook (debounced)\n   *\u002F\n  async handleWebhook(userId, guid, reason) {\n    const key = `${userId}`;\n\n    \u002F\u002F Debounce multiple webhooks for same user\n    if (this.pendingWebhooks.has(key)) {\n      clearTimeout(this.pendingWebhooks.get(key));\n    }\n\n    this.pendingWebhooks.set(key, setTimeout(async () => {\n      this.pendingWebhooks.delete(key);\n      await this.processUserChanges(userId);\n    }, this.debounceMs));\n  }\n\n  \u002F**\n   * Process changes for a user\n   *\u002F\n  async processUserChanges(userId) {\n    \u002F\u002F Prevent concurrent processing\n    if (this.processingLock.has(userId)) {\n      console.log(`Already processing for user ${userId}`);\n      return;\n    }\n\n    this.processingLock.set(userId, true);\n\n    try {\n      \u002F\u002F Get last known update count\n      const lastUpdateCount = await this.getStoredUpdateCount(userId);\n\n      \u002F\u002F Check if sync needed\n      if (!await this.syncService.needsSync(lastUpdateCount)) {\n        console.log(`No changes for user ${userId}`);\n        return;\n      }\n\n      \u002F\u002F Perform incremental sync\n      const changes = await this.syncService.incrementalSync(lastUpdateCount);\n\n      \u002F\u002F Emit events for changes\n      this.emitChangeEvents(userId, changes);\n\n      \u002F\u002F Store new update count\n      const state = await this.syncService.getSyncState();\n      await this.storeUpdateCount(userId, state.updateCount);\n\n    } finally {\n      this.processingLock.delete(userId);\n    }\n  }\n\n  \u002F**\n   * Emit events for detected changes\n   *\u002F\n  emitChangeEvents(userId, changes) {\n    \u002F\u002F Note events\n    for (const note of changes.notes.created) {\n      this.emit('note:created', { userId, note });\n    }\n\n    for (const note of changes.notes.updated) {\n      this.emit('note:updated', { userId, note });\n    }\n\n    for (const guid of changes.notes.deleted) {\n      this.emit('note:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Notebook events\n    for (const notebook of changes.notebooks.updated) {\n      this.emit('notebook:updated', { userId, notebook });\n    }\n\n    for (const guid of changes.notebooks.deleted) {\n      this.emit('notebook:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Tag events\n    for (const tag of changes.tags.updated) {\n      this.emit('tag:updated', { userId, tag });\n    }\n\n    for (const guid of changes.tags.deleted) {\n      this.emit('tag:deleted', { userId, guid });\n    }\n\n    \u002F\u002F Summary event\n    this.emit('sync:complete', {\n      userId,\n      summary: {\n        notesCreated: changes.notes.created.length,\n        notesUpdated: changes.notes.updated.length,\n        notesDeleted: changes.notes.deleted.length\n      }\n    });\n  }\n\n  \u002F\u002F Storage methods (implement with your database)\n  async getStoredUpdateCount(userId) {\n    \u002F\u002F Return stored update count for user\n    return 0; \u002F\u002F Default to 0 for initial sync\n  }\n\n  async storeUpdateCount(userId, updateCount) {\n    \u002F\u002F Store update count for user\n  }\n}\n\nmodule.exports = EvernoteEventProcessor;\n```\n\n### Step 5: Event Handlers\n\n```javascript\n\u002F\u002F handlers\u002Fevent-handlers.js\nconst processor = require('.\u002Fevent-processor');\n\n\u002F\u002F Handle new notes\nprocessor.on('note:created', async ({ userId, note }) => {\n  console.log(`New note created: ${note.title}`);\n\n  \u002F\u002F Example: Index for search\n  await searchIndex.indexNote(note);\n\n  \u002F\u002F Example: Send notification\n  await notifications.send(userId, {\n    type: 'note_created',\n    title: note.title\n  });\n});\n\n\u002F\u002F Handle note updates\nprocessor.on('note:updated', async ({ userId, note }) => {\n  console.log(`Note updated: ${note.title}`);\n\n  \u002F\u002F Example: Update search index\n  await searchIndex.updateNote(note);\n\n  \u002F\u002F Example: Sync to external service\n  await externalSync.updateNote(userId, note);\n});\n\n\u002F\u002F Handle note deletions\nprocessor.on('note:deleted', async ({ userId, guid }) => {\n  console.log(`Note deleted: ${guid}`);\n\n  \u002F\u002F Example: Remove from search index\n  await searchIndex.removeNote(guid);\n\n  \u002F\u002F Example: Clean up related data\n  await database.cleanupNoteData(guid);\n});\n\n\u002F\u002F Handle sync completion\nprocessor.on('sync:complete', ({ userId, summary }) => {\n  console.log(`Sync complete for user ${userId}:`, summary);\n\n  \u002F\u002F Example: Log metrics\n  metrics.recordSync({\n    userId,\n    ...summary\n  });\n});\n```\n\n### Step 6: Webhook Registration\n\n```javascript\n\u002F\u002F Note: Webhook registration is done through Evernote Developer Portal\n\u002F\u002F API key settings, not through the API itself.\n\n\u002F\u002F Webhook configuration in Evernote Developer Portal:\n\u002F\u002F 1. Go to https:\u002F\u002Fdev.evernote.com\u002F\n\u002F\u002F 2. Navigate to your API key settings\n\u002F\u002F 3. Enable webhooks\n\u002F\u002F 4. Set webhook URL: https:\u002F\u002Fyour-domain.com\u002Fwebhooks\u002Fevernote\n\n\u002F\u002F For local development, use ngrok:\n\u002F\u002F ngrok http 3000\n\u002F\u002F Then update webhook URL temporarily in developer portal\n```\n\n### Step 7: Polling Fallback\n\n```javascript\n\u002F\u002F services\u002Fpolling-service.js\n\n\u002F**\n * Fallback polling for when webhooks aren't available\n * or as a backup sync mechanism\n *\u002F\nclass PollingService {\n  constructor(syncService, options = {}) {\n    this.syncService = syncService;\n    this.pollInterval = options.pollInterval || 5 * 60 * 1000; \u002F\u002F 5 minutes\n    this.users = new Map(); \u002F\u002F userId -> lastUpdateCount\n    this.timer = null;\n  }\n\n  \u002F**\n   * Start polling for a user\n   *\u002F\n  addUser(userId, accessToken) {\n    this.users.set(userId, {\n      accessToken,\n      lastUpdateCount: 0\n    });\n  }\n\n  \u002F**\n   * Remove user from polling\n   *\u002F\n  removeUser(userId) {\n    this.users.delete(userId);\n  }\n\n  \u002F**\n   * Start polling loop\n   *\u002F\n  start() {\n    if (this.timer) return;\n\n    this.timer = setInterval(async () => {\n      await this.pollAllUsers();\n    }, this.pollInterval);\n\n    console.log(`Polling started (interval: ${this.pollInterval}ms)`);\n  }\n\n  \u002F**\n   * Stop polling\n   *\u002F\n  stop() {\n    if (this.timer) {\n      clearInterval(this.timer);\n      this.timer = null;\n    }\n  }\n\n  \u002F**\n   * Poll all registered users\n   *\u002F\n  async pollAllUsers() {\n    for (const [userId, data] of this.users) {\n      try {\n        await this.pollUser(userId, data);\n      } catch (error) {\n        console.error(`Poll failed for user ${userId}:`, error.message);\n      }\n    }\n  }\n\n  \u002F**\n   * Poll single user for changes\n   *\u002F\n  async pollUser(userId, data) {\n    const state = await this.syncService.getSyncState();\n\n    if (state.updateCount > data.lastUpdateCount) {\n      console.log(`Changes detected for user ${userId}`);\n\n      const changes = await this.syncService.incrementalSync(\n        data.lastUpdateCount\n      );\n\n      \u002F\u002F Update stored count\n      data.lastUpdateCount = state.updateCount;\n\n      \u002F\u002F Process changes\n      await this.processChanges(userId, changes);\n    }\n  }\n\n  async processChanges(userId, changes) {\n    \u002F\u002F Same processing as webhook handler\n  }\n}\n\nmodule.exports = PollingService;\n```\n\n## Output\n\n- Webhook endpoint implementation\n- Sync state management\n- Event-driven change processing\n- Event handlers for note lifecycle\n- Polling fallback mechanism\n\n## Webhook vs Polling\n\n| Aspect | Webhooks | Polling |\n|--------|----------|---------|\n| Latency | Near real-time | Poll interval |\n| Rate limit impact | None | Uses API quota |\n| Reliability | Depends on network | Consistent |\n| Setup complexity | Requires public URL | Simple |\n| Recommended | Production | Development\u002Fbackup |\n\n## Error Handling\n\n| Issue | Cause | Solution |\n|-------|-------|----------|\n| Webhook not received | URL not reachable | Verify HTTPS endpoint |\n| Duplicate webhooks | Network retries | Implement idempotency |\n| Missing changes | Race condition | Re-sync after timeout |\n| Sync timeout | Large change set | Increase chunk size |\n\n## Resources\n\n- [Webhooks Overview](https:\u002F\u002Fdev.evernote.com\u002Fdoc\u002Farticles\u002Fwebhooks.php)\n- [Synchronization](https:\u002F\u002Fdev.evernote.com\u002Fdoc\u002Farticles\u002Fsynchronization.php)\n- [Developer Portal](https:\u002F\u002Fdev.evernote.com\u002F)\n\n## Next Steps\n\nFor performance optimization, see `evernote-performance-tuning`.\n",{"name":5,"author":48,"license":15,"version":49,"description":50,"allowed-tools":51},"Jeremy Longshore \u003Cjeremy@intentsolutions.io>","1.0.0","Implement Evernote webhook notifications and sync events.\nUse when handling note changes, implementing real-time sync,\nor processing Evernote notifications.\nTrigger with phrases like \"evernote webhook\", \"evernote events\",\n\"evernote sync\", \"evernote notifications\".\n","Read, Write, Edit, Bash(curl:*)","main","90b50ed0778745a80fd5bfb13b1843d45b9e82f7","tests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fevernote-pack\u002Fskills\u002Fevernote-webhooks-events",233,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust","https:\u002F\u002Fgithub.com\u002FDicklesworthstone","https:\u002F\u002Fwww.jeffreyemanuel.com\u002F","Building in NY","2026-11-15 01:54:15",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add Dicklesworthstone\u002Fpi_agent_rust --skill evernote-webhooks-events",{"tool":67,"command":68},"bunx","bunx skills add Dicklesworthstone\u002Fpi_agent_rust --skill evernote-webhooks-events",{"tool":70,"command":71},"pnpm","pnpm dlx skills add Dicklesworthstone\u002Fpi_agent_rust --skill evernote-webhooks-events","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Fplugins-community\u002Fplugins\u002Fsaas-packs\u002Fevernote-pack\u002Fskills\u002Fevernote-webhooks-events\u002FSKILL.md",true,[],[76,109,144,167,193,220],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":81,"sourceHtmlUrl":82,"categories":83,"keywords":89,"publishedAt":108},"01M6FCR7G5A005P364Z6ZWCJDP","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fcreative-design\u002Ftheme-factory\u002FSKILL.md",[84],{"categoryNo":85,"categoryName":86,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,27,106,107],"theme factory","factory","theme","docs","toolkit","generate","artifacts","SET","fly","slides","landing","html","styling","artifact","pages","themes","you","fonts","2026-11-11 15:11:14",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":113,"sourceHtmlUrl":114,"categories":115,"keywords":119,"publishedAt":43},"01M6FEGPPK0ZTKCCM0R3E3KS33","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[116],{"categoryNo":117,"categoryName":118,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000009","前端开发",[120,121,96,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,34,101,137,138,139,140,141,142,143],"web artifacts builder","web","artifacts builder","builder","frontend","css","components","react","component","routing","state management","state","shadcn","file","ui","Tools","Tailwind","single-file","simple","ui components","multi","for","jsx","suite",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":148,"sourceHtmlUrl":149,"categories":150,"keywords":155,"publishedAt":43},"01M6FEE9VTK1W4GY21AKREJXRG","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[151,154],{"categoryNo":152,"categoryName":153,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":117,"categoryName":118,"taxonomyType":87,"taxonomyTypeDesc":88},[156,157,158,124,159,160,121,161,94,162,134,163,164,165,166,27,141],"testing","webapp testing","webapp","screenshots","playwright","debugging","browser","logs","applications","behavior","local",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":171,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":43},"01M6FE20F7ZTQBFWKF4MPJ2SBX","neuropixels-analysis","Neuropixels neural recording analysis. Load SpikeGLX\u002FOpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen\u002FIBL curation, AI-assisted visual analysis, for Neuropixels 1.0\u002F2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fneuropixels-analysis\u002FSKILL.md",[],[175,176,177,178,179,180,181,182,34,183,184,185,186,187,188,189,27,190,191,192,141,24],"analysis","neuropixels analysis","spike","metrics","data","open","quality","user","recordings","Neural","motion","visual","quality metrics","unit","sorting","curation","recording","load",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":197,"sourceHtmlUrl":198,"categories":199,"keywords":203,"publishedAt":43},"01M6FDP0PDK6F1GGX395C7625Z","skill-creator","Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fskill-creator\u002FSKILL.md",[200],{"categoryNo":201,"categoryName":202,"taxonomyType":87,"taxonomyTypeDesc":88},"01JBSEEDCAT000000000000023","Skill与智能体开发",[204,205,206,207,208,209,210,211,212,213,214,215,216,217,27,141,218,24,219],"skill creator","creator","workflows","create","update","capabilities","knowledge","tool","integrations","specialized","guide","new skill","existing skill","users","Existing","new",{"skillNo":221,"name":222,"nameZh":6,"description":223,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":224,"sourceHtmlUrl":225,"categories":226,"keywords":228,"publishedAt":43},"01M6FDM8Y7VK7NYG9SM7QPA3PW","notebooklm","Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fnotebooklm\u002FSKILL.md",[227],{"categoryNo":201,"categoryName":202,"taxonomyType":87,"taxonomyTypeDesc":88},[222,229,230,231,232,233,234,162,235,236,34,237,238,239,240,141,241],"google","browser automation","gemini","automation","auth","code","library","management","only","document","query","Citation","source"]