• Establishes a connection with a Salesforce org. Requires that a Connected App has been registered with the Salesforce org.

    In order for the user to authorize the app, a window is opened to the auth endpoint of the Salesforce org. The user logs in and then authorizes the app to access their Salesforce data, at which point the promise resolves with a connection object.

    If an existing connection exists that is still valid, that connection will be returned without the user having to re-auth.

    If the authorization process is not completed successfully for any reason, or if a connection cannot be established to the Salesforce org, an error will be thrown.

    Returns

    A connection which can be used to retrieve data and execute requests against the Salesforce org.

    Throws

    AuthorizationError Thrown if the authorization process does not complete successfully.

    Throws

    ConnectionError Thrown if a connection cannot be established to the Salesforce org after authorization.

    Throws

    ParameterError Thrown if invalid function parameter values are detected.

    Parameters

    • salesforceOrgBaseUri: string

      The base URI of the Salesforce org to connect to, which should be in the form: https://MyDomainName.my.salesforce.com.

    • consumerKey: string

      The Consumer Key of the Connected App to use for authorization.

    Returns Promise<SalesforceConnection>

Generated using TypeDoc