---
schema_version: "1"
id: 87ed44c7bcecbb62bf4a3c190c2d831ade7fd6d19d26fa1c2bf302ea9c280be0
title: Connect to Open CTI
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/api-cti/guides/sforce-api-cti-connecting.md
canonical_url: https://developer.salesforce.com/docs/service/api-cti/guide/sforce-api-cti-connecting.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 450142b86606014888830c4c0b8119e517b73f445bda5f5550fa49f062af455b
products:
  - Open CTI Developer Guide
  - Service Cloud Developer Content
---

# Connect to Open CTI

The first portion of any JavaScript code that uses the Open CTI must make the toolkit available to the JavaScript code. The syntax for this is different depending on whether you are embedding JavaScript in a Visualforce page or a page developed using any web technologies and served from a third-party domain.

**tip:** The version of Open CTI is in the URL.

## For Visualforce Pages

For Visualforce pages or any source other than a custom `onclick` JavaScript button, specify a `<script>` tag that points to the Open CTI JavaScript library file.

- In Salesforce Classic:

    - : 
      ```visualforce
      <apex:page>
                <script src="/support/api//interaction.js" type="text/javascript"></script>
           ...
      </apex:page>
      ```

 
- In Lightning Experience:

    - : 
      ```visualforce
      <apex:page>
                <script src="/support/api//lightning/opencti_min.js" type="text/javascript"></script>
           ...
      </apex:page>
      ```

For Visualforce, we recommend using a relative path to include `interaction.js` or `opencti_min.js`.

## For a Third-Party Domain

For third-party domains, specify an absolute URL to `interaction.js` or `opencti_min.js` to use the toolkit.

- In Salesforce Classic:

    - : 
      ```html
      <script src="https://MYDOMAINNAME--PACKAGENAME.vf.force.com/support/api//interaction.js" type="text/javascript"></script>
      ```

 
- In Lightning Experience:

    - : 
      ```html
      <script src="https://MYDOMAINNAME--PACKAGENAME.vf.force.com/support/api//lightning/opencti_min.js" type="text/javascript"></script>
      ```

