Salesforce
Docs HomeProduct SiteSupport
  • WireBootstrap for Salesforce
  • Installation
  • Access Tokens
  • Data Connector
  • Queries
  • Discovery
Powered by GitBook
On this page
  • Data Source
  • Authentication
  • Service Root
  • CORS

Data Connector

PreviousAccess TokensNextQueries

Last updated 3 years ago

The is a data service that allows object data and meta data in Salesforce to be securely accessed by custom applications.

The WireBootstrap for Salesforce Data Connector is a that can talk to Salesforce using the Salesforce REST API.

Using the data connector, Salesforce objects can be queried from WireBootstrap applications. The data connector also provides access to Salesforce meta data such as lists of objects and their fields using features.

Data Source

To use the data connector, create a using the connector's service provider key in the initialization. The service provider key for the WireBootstrap for Salesforce Data Connector is sf.

const source = new wire.data.DataSource("sf", {
    ...
});

Authentication

For security, the Salesforce REST API requires an access token. For details on creating a Salesforce access token, visit .

Below is a sample access token object returned from a call to Salesforce for a token.

const response = {
    instance_url: "https://domain-dev-my.salesforce.com",
    access_token: "eyJ0e...Agjmg"
    token_type: "Bearer"
}

To set up the security for data source calls, use the Headers property during the data source initialization. Set Authorization property using the token response object returned from Salesforce.


const source = new wire.data.DataSource("sf", {
    Headers: { Authorization: response.token_type + " " + reponse.access_token },
    ...      
});

Service Root

Use the ServiceRoot configuration property on the data source to specify the end point for the Salesforce REST API. This will be in the instance_url property on the token response object.

const source = new wire.data.DataSource("sf", {
    ServiceRoot: response.instance_url,
    ...
});

CORS

CORS must be configured in Salesforce to allow the WireBootstrap for Salesforce Data Connector to access data returned from calls to Salesforce from a web browser.

For details visit, .

Salesforce REST API
WireBootstrap data connector
WireBootstrap's data discovery
WireBootstrap data source
Access Tokens
Configure Salesforce CORS Allow List