AboutSupportDeveloper GuideVersion 2.3.0
  • Initiates the OAuth 2.0 web server flow and establishes a connection with a Salesforce org. Requires that a Connected App has been registered in the target org.

    After the function has been called, the user may be prompted to authenticate to Salesforce or to authorize the Connected App to act on their behalf, depending on the Salesforce org configuration.

    Parameters

    • orgUrl: string

      The URL 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.

    • scope: string[] = DEFAULT_SCOPE

      Provide any additional OAuth scopes that may be required by your app.

    • Optional authFlowParams: AuthFlowParams

      Optionally modify the authorization process by providing additional parameters.

    • Optional authWindowOptions: AuthWindowOptions

      Optionally change the appearance and behavior of the authorization popup window by specifying additional options.

    Returns Promise<SalesforceConnection>

    A connection which can be used to execute requests against the Salesforce REST API.

    Throws

    AuthorizationError if the authorization process does not complete successfully.

    Throws

    ParameterError if invalid function parameter values are detected.

Generated using TypeDoc