crisboarna / fb-messenger-bot-api

NodeJS Facebook Messenger API for bots to send messages and setup events to Facebook.
https://www.npmjs.com/package/fb-messenger-bot-api
MIT License
34 stars 17 forks source link

`proxyData` parameter is not optional in`Client` constructor #44

Closed rasikas closed 6 years ago

rasikas commented 6 years ago

According to your example, Client should be constructed without proxyData

import {Client} from 'fb-messenger-bot-api';
const client = new Client(process.env.PAGE_ACCESS_TOKEN);

However proxyData is not marked as optional so we always have to pass undefined as the second param. (when using the library in a typescript project) https://github.com/crisboarna/fb-messenger-bot-api/blob/master/src/client/Client.ts#L39

  public constructor(token: string, proxyData: ProxyData) {
    this.requestData = { token };
    this.requestData = Utils.getProxyData(this.requestData, proxyData);
  }
crisboarna commented 6 years ago

Hey, thank you for pointing it out. I will finish the release today and will publish a new version solving all present issues + suggestions + more.

crisboarna commented 6 years ago

Made proxyData optional in latest version.