4.22.2 • Published 12 days ago

botframework-connector v4.22.2

Weekly downloads
24,754
License
MIT
Repository
github
Last release
12 days ago

Microsoft Bot Framework Connector for Node.js

Within the Bot Framework, the Bot Connector service enables your bot to exchange messages with users on channels that are configured in the Bot Framework Portal.

Requirement

  • Node.js version: 6.x.x or higher

How to Install

npm install botframework-connector

How to Use

Authentication

Your bot communicates with the Bot Connector service using HTTP over a secured channel (SSL/TLS). When your bot sends a request to the Connector service, it must include information that the Connector service can use to verify its identity.

To authenticate the requests, you'll need configure the Connector with the App ID and password that you obtained for your bot during registration and the Connector will handle the rest.

More information: https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication

Example

Client creation (with authentication), conversation initialization and activity send to user.

var { ConnectorClient, MicrosoftAppCredentials } = require('botframework-connector');

async function connectToSlack() {
    var credentials = new MicrosoftAppCredentials('<your-app-id>', '<your-app-password>');

    var botId = '<bot-id>';
    var recipientId = '<user-id>';

    var client = new ConnectorClient(credentials, { baseUri: 'https://slack.botframework.com' });

    var conversationResponse = await client.conversations.createConversation({
        bot: { id: botId },
        members: [
            { id: recipientId }
        ],
        isGroup: false
    });

    var activityResponse = await client.conversations.sendToConversation(conversationResponse.id, {
        type: 'message',
        from: { id: botId },
        recipient: { id: recipientId },
        text: 'This a message from Bot Connector Client (NodeJS)'
    });

    console.log('Sent reply with ActivityId:', activityResponse.id);
}

Simple EchoBot Example (source code)

EchoBot is a minimal bot that receives message activities and replies with the same content. The sample shows how to use restify/express for listening to activities and the ConnectorClient for sending activities.

Rest API Documentation

For the Connector Service API Documentation, please see our API reference.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License.

4.22.2

12 days ago

4.17.0-spike1

26 days ago

4.17.0-dev1

1 month ago

4.22.2-rc2

1 month ago

4.14.1-dev8

2 months ago

4.22.1

3 months ago

4.22.2-rc1

3 months ago

4.21.5-rc

3 months ago

4.22.0

3 months ago

4.14.1-dev7

3 months ago

4.14.1-dev6

3 months ago

4.21.4

4 months ago

4.14.1-dev5

4 months ago

4.21.4-rc2

4 months ago

4.21.4-rc

4 months ago

4.14.1-dev4

4 months ago

4.21.4-dev2

4 months ago

4.14.1-dev3

5 months ago

4.21.4-dev

5 months ago

4.21.3-rc

5 months ago

4.21.3

5 months ago

4.21.1

6 months ago

4.21.2

5 months ago

4.21.0

6 months ago

4.20.2

6 months ago

4.20.3

5 months ago

4.20.1

7 months ago

4.20.1-rc

7 months ago

4.21.1-rc2

6 months ago

4.14.1-dev1

6 months ago

4.14.1-dev2

5 months ago

4.21.1-rc

6 months ago

4.20.0-rc

11 months ago

4.20.0

11 months ago

4.19.3-rc

1 year ago

4.19.3-rc2

1 year ago

4.19.3-rc4

1 year ago

4.19.3-rc5

1 year ago

4.19.1-rc1

1 year ago

4.19.1

1 year ago

4.19.2

1 year ago

4.19.3

1 year ago

4.19.1-rc

1 year ago

4.19.0-rc

1 year ago

4.19.0

1 year ago

4.18.0-rc0

2 years ago

4.18.0

2 years ago

4.17.0-rc

2 years ago

4.17.1-rc0-rc

2 years ago

4.17.0

2 years ago

4.17.1

2 years ago

4.16.0

2 years ago

4.15.0

2 years ago

4.15.0-rc1

2 years ago

4.15.0-rc3

2 years ago

4.15.0-rc2

2 years ago

4.15.0-rc0

3 years ago

4.14.1

3 years ago

4.14.0

3 years ago

4.14.0-rc2

3 years ago

4.14.0-rc1

3 years ago

4.14.0-rc0

3 years ago

4.10.6-rc0

3 years ago

4.9.5

3 years ago

4.9.5-rc0

3 years ago

4.9.5-rc1

3 years ago

4.13.6

3 years ago

4.11.2-rc0

3 years ago

4.12.1-rc0

3 years ago

4.13.6-rc0

3 years ago

4.10.6

3 years ago

4.12.1

3 years ago

4.11.2

3 years ago

4.13.5

3 years ago

4.13.4

3 years ago

4.13.3

3 years ago

4.13.2

3 years ago

4.13.1

3 years ago

4.13.0

3 years ago

4.13.0-rc9

3 years ago

4.13.0-rc8

3 years ago

4.13.0-rc7

3 years ago

4.13.0-rc6

3 years ago

4.13.0-rc5

3 years ago

4.13.0-rc4

3 years ago

4.13.0-rc3

3 years ago

4.13.0-rc2

3 years ago

4.14.0-dev

3 years ago

4.13.0-rc0

3 years ago

4.13.0-rc1

3 years ago

4.12.0

3 years ago

4.12.0-rc4

3 years ago

4.12.0-rc3

3 years ago

4.12.0-rc2

3 years ago

4.12.0-rc1

3 years ago

4.12.0-rc0

3 years ago

4.11.1

3 years ago

4.10.5

3 years ago

4.9.4

3 years ago

4.8.1

3 years ago

4.7.3

3 years ago

4.11.1-rc0

3 years ago

4.11.0

3 years ago

4.11.0-rc3

3 years ago

4.11.0-rc2

3 years ago

4.11.0-rc1

3 years ago

4.11.0-rc0

4 years ago

4.10.4

4 years ago

4.10.3

4 years ago

4.10.2-rc0

4 years ago

4.10.1

4 years ago

4.10.0

4 years ago

4.10.0-rc1

4 years ago

4.10.0-rc0

4 years ago

4.9.3

4 years ago

4.9.2

4 years ago

4.9.1

4 years ago

4.9.0

4 years ago

4.8.0

4 years ago

4.7.2

4 years ago

4.7.1

4 years ago

4.7.0

4 years ago

4.6.2

4 years ago

4.6.1

4 years ago

4.6.0

4 years ago

4.6.0-preview1

5 years ago

4.5.3

5 years ago

4.5.2

5 years ago

4.5.1

5 years ago

4.5.0

5 years ago

4.4.0

5 years ago

4.3.4

5 years ago

4.3.2

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.1.7

5 years ago

4.1.6

5 years ago

4.1.5

5 years ago

4.1.3

5 years ago

4.0.8

6 years ago

4.0.6

6 years ago

4.0.0-preview1.2

6 years ago

4.0.0-preview1.1

6 years ago

4.0.0-preview1.0

6 years ago

4.0.0-m4.2

6 years ago

4.0.0-m4.1

6 years ago

4.0.0-m4.0

6 years ago

4.0.0-m3.0

6 years ago

4.0.0-m2.2

6 years ago

4.0.0-m2.1

6 years ago

4.0.0-m2.0

6 years ago

4.0.0-m1.10

6 years ago

4.0.0-m1.9

6 years ago

4.0.0-m1.7

6 years ago

4.0.0-m1.6

6 years ago

4.0.0-m1.5

6 years ago

4.0.0-m1.2

6 years ago

4.0.0-m1.0

6 years ago

4.0.0-alpha2

6 years ago