Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Made minor grammar and spelling changes

...

Note

The content on page is for the beta release of API Builder 1.10.0. You may find some information is either missing, incomplete , or in general draft state.

...

This guide covers the basics to create and build a Connector. A Connector is a component of an a project that allows you to access data from an external source. A Connector is setup set up the same as an a Builder project except you have logic for your connector in the lib folder, and do not have API, Block or Web components.

...

Code Block
titlepackage.json
{ ...
  "dependencies" : {
    ...
    "twitter": "~1.2.5"
  }
 ... 
}

Configuration file

The boiler plate boilerplate sample contains the conf/default.js configuration file. This file is used for testing the connector. You will also need to create a configuration file called example.config.js. When you install the connector, this file is copied in the project's conf directory. You need to add settings to configure your connector in these files, specifically add the settings to the connectors object. For the Twitter connector, it will need the app keys, OAuth tokens, and an account name of the Twitter feed to access. Create the conf/example.config.js file, then add the content below to it. You will also need to add the following keys to the connectors object in the conf/default.js file and add your Twitter app information to it for testing purposes.

...

The app.js file contains code that initializes the connector when it is used as a server for testing. You can hook into the lifecycle events of the server. The boiler plate boilerplate file contains logic that is used to create a model. Update the code to let the application create a connector and access the tweet's text response parameter as the status parameter. Later on, you will add logic to automatically create a model when a connector is installed on an application.

...