---
"title": "Using force.com from your Heroku apps"
"description": "Force.com and Heroku are both part of the Salesforce1 platform. There are lots of great ways to leverage force.com from your Heroku app. This article..."
"date": "2014-07-08"
"authors":
  -
    "name": "Scott Persinger"
"url": "https://wp-www-staging.heroku.com/blog/forcedotcom-libs/"
"categories":
  - "Engineering"
"tags":
  - "Developer Tools"
  - "Heroku Connect"
  - "Salesforce"
---

# Using force.com from your Heroku apps

[Force.com](https://force.com) and [Heroku](https://wp-www-staging.heroku.com/) are both part of the [Salesforce1](https://www.salesforce.com/products/platform/) platform. There are lots of great ways to leverage force.com from your Heroku app. This article will give an overview and pointers to get you started.

## [Heroku Connect](#heroku-connect)

The easiest way to link force.com and Heroku is to use our two-way data synchronization service [Heroku Connect](https://wp-www-staging.heroku.com/connect/). This point-and-click service lets you synchronize data from force.com into the Postgres database attached to your Heroku app. You can read and write data directly in Postgres, and changes are automatically synchronized with force.com. Note that Heroku Connect moves data *asynchronously*. This means that when your app writes data to Postgres, control flow returns as soon as the data is written to the database. The data won’t be copied to force.com until later (various factors affect latency). The asynchronous operation has some advantages, but isn’t a fit for situations where you need the answer from force.com immediately.

## [Force.com client libraries](#force-com-client-libraries)

There are great client libraries for accessing force.com available for almost any language. These libraries give you synchronous access to many of the APIs provided by force.com. All of these libraries are open source, and you are encouraged to submit issues, patches, or improvements. Force.com offers a number of different APIs. Here is a quick rundown on those APIs to help you find the client library that access the API you want:

| API | Description |
| --- | --- |
| SOAP | CRUD API using SOAP protocol, support for batch operations |
| REST | CRUD API using REST (JSON or XML over HTTP) |
| Streaming | Event notification API using *CometD* protocol |
| Bulk | Asynchronous API for reading or writing large amounts of data |
| Metadata | API for making schema modifications |

## [Java](#java)

The force.com [Web Service Connector](https://github.com/forcedotcom/wsc) is the standard client library published by Salesforce for accessing force.com. You can use the WSC to interact with the force.com *SOAP API* or *Bulk API*. You can access the force.com [Streaming API](https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm) using the standard [CometD](https://download.cometd.org/cometd-2.2.0-distribution.tar.gz) implementation.

## [Ruby](#ruby)

Access the force.com *REST API* and *Streaming API* with the [restforce](https://github.com/ejholmes/restforce) gem:

```
gem install restforce
```

You can access the *Bulk API* with the [salesforce\_bulk](https://github.com/jorgevaldivia/salesforce_bulk) gem:

```
gem install salesforce_bulk
```

## [Node.js](#node-js)

Node.js is supported by the awesome [nforce](https://github.com/kevinohara80/nforce) package from Kevin O’Hara:

```
npm install nforce
```

Nforce supports the *REST API* and the *Streaming API*.

## [PHP](#php)

Access the *SOAP API* using the [Force.com Toolkit for PHP](https://github.com/developerforce/Force.com-Toolkit-for-PHP).

## [Python](#python)

Access the *REST API* using the [simple-salesforce](https://github.com/neworganizing/simple-salesforce) package:

```
pip install simple_salesforce
```

An older library for accessing the *SOAP API* is the [salesforce-python-toolkit](https://code.google.com/p/salesforce-python-toolkit/). You can access the *Bulk API* with the [salesforce-bulk](https://github.com/heroku/salesforce-bulk) package:

```
pip install salesforce-bulk
```

## [Objective-C (iOS)](#objective-c-ios)

Salesforce publishes the *Salesforce Mobile SDK for iOS* here: [https://github.com/forcedotcom/SalesforceMobileSDK-iOS](https://github.com/forcedotcom/SalesforceMobileSDK-iOS)

## [Java – Android](#java-android)

Salesforce publishes the *Salesforce Mobile SDK for Android* here: [https://github.com/forcedotcom/SalesforceMobileSDK-Android](https://github.com/forcedotcom/SalesforceMobileSDK-Android)

## [Command line](#command-line)

The force.com *Command Line Interface* is a utility written in *GO* for accessing the *SOAP API* and *Metadata API*. It can be very useful for scripting operations to force.com: [https://github.com/ForceCLI/force](https://github.com/ForceCLI/force)