{"size": 835, "ext": "js", "max_stars_repo_path": "packages/plugin-azure-search/examples/node-app/index.js", "max_stars_repo_name": "academydistrict20/notifications", "max_stars_repo_stars_event_min_datetime": "2020-05-08T04:34:18.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-19T16:30:39.000Z", "max_issues_repo_path": "packages/plugin-cc-messages/examples/node-app/index.js", "max_issues_repo_name": "academydistrict20/notifications", "max_issues_repo_issues_event_min_datetime": "2020-05-08T00:18:49.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-14T14:34:45.000Z", "max_forks_repo_path": "packages/plugin-cc-messages/examples/node-app/index.js", "max_forks_repo_name": "academydistrict20/notifications", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 97, "max_forks_count": null, "avg_line_length": 25.303030303, "max_line_length": 73, "alphanum_fraction": 0.6167664671}
const NotificationsClient = require('@asd20/notifications-client')
const MessagesPlugin = require('@asd20/notifications-plugin-cc-messages')
const fetch = require('node-fetch')

// Enable fetcch support globally
if (!globalThis.fetch) {
  globalThis.fetch = fetch
}

async function run() {
  try {
    const client = new NotificationsClient({
      onUpdate(payload) {
        console.log('update', payload)
      },
      plugins: [
        MessagesPlugin.Create({
          endpoint: 'https://asd20-search-dev.search.windows.net',
          index: 'messages-index',
          apiKey: '937716815402758ADC2FE799FE288142',
          apiVersion: '2019-05-06',
          search: 'COVID-19',
          channels: ['News & Stories'],
        }),
      ],
    })
    console.log(client)
  } catch (error) {
    console.log(error)
  }
}
run()
