npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@azure/functions-extensions-connectors

v0.0.2-preview

Published

Azure Functions Connectors Extension - SDK binding for Azure Logic Apps connectors

Readme

@azure/functions-extensions-connectors

Azure Functions extension for Azure Logic Apps connectors. Provides strongly-typed SDK bindings for connector triggers with automatic payload normalization, connector-specific context types, and a first-class connectors namespace API.

Installation

npm install @azure/functions-extensions-connectors @azure/connectors @azure/functions

Quick Start

import { connectors } from '@azure/functions-extensions-connectors';

connectors.office365.onNewEmail('OnNewEmail', {
    handler: async (context, invocationContext) => {
        // context.emails is GraphClientReceiveMessage[] — fully typed, zero annotations needed
        for (const email of context.emails) {
            invocationContext.log(`Subject: '${email.subject}'.`);
        }
    },
});

Or with explicit type annotations:

import { connectors, EmailTriggerContext } from '@azure/functions-extensions-connectors';
import { InvocationContext } from '@azure/functions';

connectors.office365.onNewEmail('OnNewEmail', {
    handler: async (context: EmailTriggerContext, invocationContext: InvocationContext) => {
        for (const email of context.emails) {
            invocationContext.log(`Subject: '${email.subject}'.`);
        }
    },
});

Supported Connectors

| Registration | Context Type | Named Property | Item Type | |---|---|---|---| | connectors.office365.onNewEmail() | EmailTriggerContext | emails | GraphClientReceiveMessage[] | | connectors.office365.onNewCalendarEvent() | CalendarEventTriggerContext | calendarEvents | GraphCalendarEventClientReceive[] | | connectors.sharepoint.onNewFile() | FileTriggerContext | files | BlobMetadata[] | | connectors.sharepoint.onUpdatedFile() | FileTriggerContext | files | BlobMetadata[] | | connectors.teams.onNewChannelMessage() | ChannelMessageTriggerContext | messages | ChatMessage[] | | connectors.kusto.onQueryResult() | QueryResultTriggerContext | rows | Row[] |

Each named property is an alias for context.items — the generic accessor still works.

Generic Registration

For connectors not yet in the connectors namespace, use the generic connectorTrigger():

import { connectorTrigger } from '@azure/functions-extensions-connectors';

connectorTrigger<MyItemType>('MyFunction', {
    handler: async (context, invocationContext) => {
        for (const item of context.items) { /* fully typed */ }
    },
});

Configure App Settings

Add the connector connection runtime URL to your local.settings.json:

{
    "Values": {
        "Office365Connection": "<your-connector-runtime-url>"
    }
}

How It Works

  1. connectorTrigger() wraps app.connectorTrigger() from @azure/functions with payload normalization into a typed ConnectorTriggerContext.
  2. When the Connector Gateway fires the trigger callback, the wrapper parses the JSON payload and normalizes batch/single-item formats into a consistent items array.
  3. Connector-specific wrappers (e.g., onNewEmail) add named aliases (emails, files, etc.) to the context for better readability.
  4. Malformed payloads are logged as warnings via InvocationContext.warn() and produce empty contexts (the handler still runs).

API Reference

ConnectorTriggerContext<TItem>

| Property | Type | Description | |----------|------|-------------| | payload | TriggerCallbackPayload<TItem> | Normalized envelope with body.value as TItem[] | | items | TItem[] | Convenience accessor for payload.body.value | | rawPayload | unknown | Original payload as received from the host | | toJSON() | string | Serializes the full trigger payload to JSON |

ConnectorTriggerOptions<TItem, TContext>

| Option | Type | Description | |--------|------|-------------| | handler | ConnectorTriggerHandler<TItem, TContext> | Async handler receiving the trigger context and InvocationContext | | extraInputs | FunctionInput[] | Optional extra input bindings | | extraOutputs | FunctionOutput[] | Optional extra output bindings | | return | FunctionOutput | Optional return output binding |

Exported Types

All connector SDK item types are re-exported for convenience:

  • GraphClientReceiveMessage, GraphCalendarEventClientReceive (Office 365)
  • BlobMetadata (SharePoint)
  • ChatMessage (Teams)
  • KustoRow (Kusto)
  • TriggerCallbackPayload, TriggerCallbackBody

Context Types

  • EmailTriggerContext — adds emails: GraphClientReceiveMessage[]
  • CalendarEventTriggerContext — adds calendarEvents: GraphCalendarEventClientReceive[]
  • FileTriggerContext — adds files: BlobMetadata[]
  • ChannelMessageTriggerContext — adds messages: ChatMessage[]
  • QueryResultTriggerContext — adds rows: Row[]

License

MIT