Documentation

    Quick Start

    Running Co-Browsing API On-Premise

    To run Co-Browsing API on your infrastructure, you'll need to either run a Docker image that contains everything or host the components separately yourself.

    If you have fewer than 5,000 Visitors online at any given time and no more than 100 concurrent Sessions, a single server will likely be enough. If you have more, you'll likely need to add more servers and scale Co-Browsing API horizontally by having a separate Redis cluster.

    Pull our image from Docker Hub and run it with the environment variables listed below.

    docker run -d \
      -e BASE_ENDPOINT=https://cobrowsing.acmetech.com/ \
      -e LICENSE_KEY=https://api.upscope.io/v1.3/.... \
      -e SECRET_KEY=myrandomsecretkey... \
      -p 5002:5002 \
      upscope/onpremise
    

    See the Configuration section for all available environment variables.

    Host MongoDB Connection Issues
    MongoDB cannot be listening only to localhost, because the container never uses the loopback network for connection. Set the net.bindIp to listen on 0.0.0.0 in /etc/mongod.conf, or—if it's a security issue—on the Docker network. This is similar for Redis, which should listen to *:6379.

    Installing Co-Browsing API on Your Website

    After you run Co-Browsing API, the output will give you instructions for your JavaScript SDK installation code. It looks like this (notice {BASE_ENDPOINT}):

    <script>
      (function(w, u, d){if(typeof u!=="function"){var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};
      w.Upscope=i;var l = function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;
      s.src='{BASE_ENDPOINT}/upscope.js';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};l();}}
      )(window, window.Upscope, document);
      Upscope('init');
      Upscope('getWatchLink', console.log);
    </script>
    

    You can add that code to pages like you would with our cloud solution.

    Your License Key

    To run Co-Browsing API, you'll need to retrieve your license key. The license key can be downloaded to your server or read automatically from our server every time the server starts.

    You'll need to enter the license key into the LICENSE_KEY environment variable. The LICENSE_KEY environment variable can be one of:

    • The license key content (note it's multi-line)
    • A file path to the license key content
    • The URL to the license key, the preferred method

    If you don't have to restrict the instance's interactions with the internet, entering the URL provided on the dashboard as the LICENSE_KEY environment variable is preferable as you won't need to update it when it expires.

    Good to Know
    Your JavaScript SDK configuration is also embedded in your license key. This means you can still configure Co-Browsing API on your dashboard and then restart the server to apply the changes.

    Configuration

    The following is configurable through environment variables:

    Environment VariableDescriptionDefault
    BASE_ENDPOINTThe base URL where this component will be mounted. For example, https://cobrowsing.acmetech.com/. It can be in a subdirectory.(nil, required)
    LICENSE_KEYYour unique Co-Browsing API license key (or a link to it).(nil, required)
    SECRET_KEYA unique secret key used to sign internal JWTs. It's very important this key is kept safe and it's at least 32 characters long.(nil, required)
    AUTH_ENDPOINTURL watch links will be redirected to for authentication.https://app.upscope.io/onprem_redirect/TEAM_IDENTIFIER
    HOMEPAGEURL unrecognized requests will be redirected to.https://upscope.com/
    MONGO_URIURI to a single MongoDB instance, or MongoDB clusterIf omitted, mongodb://localhost:27017/upscope. (In Docker this starts MongoDB within the image). If set to an empty string, it will disable MongoDB.
    PORTThe port the server will listen on.5002
    REDIS_URIURI to Redis or a Redis cluster.redis://localhost:6379. (In Docker this starts Redis within the image).
    REST_KEYThe authentication API key for your on-premise REST API.(nil)
    SSL_REDIRECTWhen set to on, the server will automatically redirect all requests to https.off

    If you use MONGO_URI=mongodb://localhost/upscope with the Docker image, a MongoDB server will be installed inside the container to serve the application.

    If you use redis://localhost/ with the Docker image, a Redis server will be installed inside the container to serve the application.

    API Endpoint

    Check the on-premise REST API docs to know how to make requests to the on-premise instance.

    What Doesn't Work On-Premise?

    Although we've made our on-premise version as similar as possible to the original, there are a few missing functionalities. You'll need to use Co-Browsing API cloud if you are interested in:

    • IP geolocation features
    • Session video recording
    • Audio/video communication

    Usage Without MongoDB

    We are aware some of our customers cannot use MongoDB due to compliance reasons.

    Co-Browsing API works fine without MongoDB, but the Search feature will be limited. You'll still be able to search by:

    • Lookup code
    • Email
    • Unique ID
    • Integration IDs
    \n"},{"type":"paragraph","id":"p-2","content":"You can add that code to pages like you would with our cloud solution."}]},{"type":"section","id":"your-license-key","title":"Your License Key","level":2,"link":"https://cobrowsingapi.com/docs/on-premise/quick-start#your-license-key","children":[{"type":"paragraph","id":"p-0","content":"To run Co-Browsing API, you'll need to retrieve your license key. The license key can be downloaded to your server or read automatically from our server every time the server starts."},{"type":"paragraph","id":"p-1","content":"You'll need to enter the license key into the `LICENSE_KEY` environment variable. The `LICENSE_KEY` environment variable can be one of:"},{"type":"list","id":"list-2","children":[{"type":"list-item","id":"the-license-key-content-note","title":"","content":"The license key content (note it's multi-line)","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#your-license-key::li::the-license-key-content-note-its-multi-line","meta":{"raw":"The license key content (note it's multi-line)"}},{"type":"list-item","id":"a-file-path-to-the-license-key","title":"","content":"A file path to the license key content","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#your-license-key::li::a-file-path-to-the-license-key-content","meta":{"raw":"A file path to the license key content"}},{"type":"list-item","id":"the-url-to-the-license-key-th","title":"","content":"The URL to the license key, the preferred method","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#your-license-key::li::the-url-to-the-license-key-the-preferred","meta":{"raw":"The URL to the license key, the preferred method"}}],"meta":{"ordered":false}},{"type":"paragraph","id":"p-3","content":"If you don't have to restrict the instance's interactions with the internet, entering the URL provided on the [dashboard](https://app.upscope.io/settings/teams/_/on_prem) as the `LICENSE_KEY` environment variable is preferable as you won't need to update it when it expires."},{"type":"callout","id":"good-to-know-your-javascript-sdk-configurat","title":"Good to Know","content":"Your JavaScript SDK configuration is also embedded in your license key. This means you can still configure Co-Browsing API on your dashboard and then restart the server to apply the changes.","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#your-license-key::alert::good-to-know-your-javascript-sdk-configuration-is","meta":{"calloutType":"tip"}}]},{"type":"section","id":"configuration","title":"Configuration","level":2,"link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration","children":[{"type":"paragraph","id":"p-0","content":"The following is configurable through environment variables:"},{"type":"table","id":"table-1","children":[{"type":"list-item","id":"base_endpoint-the-base-url-where-this-component","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::base_endpoint-the-base-url-where-this-component-will","meta":{"cells":{"Environment_Variable":"`BASE_ENDPOINT`","Description":"The base URL where this component will be mounted. For example, `https://cobrowsing.acmetech.com/`. It can be in a subdirectory.","Default":"(nil, **required**)"}}},{"type":"list-item","id":"license_key-your-unique-co-browsing-api-license","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::license_key-your-unique-co-browsing-api-license-key","meta":{"cells":{"Environment_Variable":"`LICENSE_KEY`","Description":"Your unique Co-Browsing API license key (or a link to it).","Default":"(nil, **required**)"}}},{"type":"list-item","id":"secret_key-a-unique-secret-key-used-to-sign-inte","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::secret_key-a-unique-secret-key-used-to-sign","meta":{"cells":{"Environment_Variable":"`SECRET_KEY`","Description":"A unique secret key used to sign internal JWTs. **It's very important this key is kept safe and it's at least 32 characters long.**","Default":"(nil, **required**)"}}},{"type":"list-item","id":"auth_endpoint-url-watch-links-will-be-redirected","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::auth_endpoint-url-watch-links-will-be-redirected-to","meta":{"cells":{"Environment_Variable":"`AUTH_ENDPOINT`","Description":"URL watch links will be redirected to for authentication.","Default":"`https://app.upscope.io/onprem_redirect/TEAM_IDENTIFIER`"}}},{"type":"list-item","id":"homepage-url-unrecognized-requests-will-be-redir","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::homepage-url-unrecognized-requests-will-be-redirected-to","meta":{"cells":{"Environment_Variable":"`HOMEPAGE`","Description":"URL unrecognized requests will be redirected to.","Default":"`https://upscope.com/`"}}},{"type":"list-item","id":"mongo_uri-uri-to-a-single-mongodb-instance-or-m","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::mongo_uri-uri-to-a-single-mongodb-instance-or","meta":{"cells":{"Environment_Variable":"`MONGO_URI`","Description":"URI to a single MongoDB instance, or MongoDB cluster","Default":"If omitted, `mongodb://localhost:27017/upscope`. (In Docker this starts MongoDB within the image). If set to an empty string, it will disable MongoDB."}}},{"type":"list-item","id":"port-the-port-the-server-will-listen-on-5002","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::port-the-port-the-server-will-listen-on","meta":{"cells":{"Environment_Variable":"`PORT`","Description":"The port the server will listen on.","Default":"`5002`"}}},{"type":"list-item","id":"redis_uri-uri-to-redis-or-a-redis-cluster-redi","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::redis_uri-uri-to-redis-or-a-redis-cluster","meta":{"cells":{"Environment_Variable":"`REDIS_URI`","Description":"URI to Redis or a Redis cluster.","Default":"`redis://localhost:6379`. (In Docker this starts Redis within the image)."}}},{"type":"list-item","id":"rest_key-the-authentication-api-key-for-your-on-","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::rest_key-the-authentication-api-key-for-your-on","meta":{"cells":{"Environment_Variable":"`REST_KEY`","Description":"The authentication API key for your on-premise REST API.","Default":"(nil)"}}},{"type":"list-item","id":"ssl_redirect-when-set-to-on-the-server-will-aut","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#configuration::tr::ssl_redirect-when-set-to-on-the-server-will","meta":{"cells":{"Environment_Variable":"`SSL_REDIRECT`","Description":"When set to on, the server will automatically redirect all requests to https.","Default":"`off`"}}}],"meta":{"headers":["Environment_Variable","Description","Default"]}},{"type":"paragraph","id":"p-2","content":"If you use `MONGO_URI=mongodb://localhost/upscope` with the Docker image, a MongoDB server will be installed inside the container to serve the application."},{"type":"paragraph","id":"p-3","content":"If you use `redis://localhost/` with the Docker image, a Redis server will be installed inside the container to serve the application."}]},{"type":"section","id":"api-endpoint","title":"API Endpoint","level":2,"link":"https://cobrowsingapi.com/docs/on-premise/quick-start#api-endpoint","children":[{"type":"paragraph","id":"p-0","content":"Check the [on-premise REST API docs](/docs/on-premise) to know how to make requests to the on-premise instance."}]},{"type":"section","id":"what-doesnt-work-on-premise","title":"What Doesn't Work On-Premise?","level":2,"link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise","children":[{"type":"paragraph","id":"p-0","content":"Although we've made our on-premise version as similar as possible to the original, there are a few missing functionalities. You'll need to use Co-Browsing API cloud if you are interested in:"},{"type":"list","id":"list-1","children":[{"type":"list-item","id":"ip-geolocation-features","title":"","content":"IP geolocation features","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise::li::ip-geolocation-features","meta":{"raw":"IP geolocation features"}},{"type":"list-item","id":"session-video-recording","title":"","content":"Session video recording","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise::li::session-video-recording","meta":{"raw":"Session video recording"}},{"type":"list-item","id":"audiovideo-communication","title":"","content":"Audio/video communication","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise::li::audiovideo-communication","meta":{"raw":"Audio/video communication"}}],"meta":{"ordered":false}},{"type":"section","id":"what-doesnt-work-on-premise-usage-without-mongodb","title":"Usage Without MongoDB","level":3,"link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise-usage-without-mongodb","children":[{"type":"paragraph","id":"p-0","content":"We are aware some of our customers cannot use MongoDB due to compliance reasons."},{"type":"paragraph","id":"p-1","content":"Co-Browsing API works fine without MongoDB, but the Search feature will be limited. You'll still be able to search by:"},{"type":"list","id":"list-2","children":[{"type":"list-item","id":"lookup-code","title":"Lookup code","content":"Lookup code","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise-usage-without-mongodb::li::lookup-code-lookup-code","meta":{"raw":"**Lookup code**"}},{"type":"list-item","id":"email","title":"Email","content":"Email","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise-usage-without-mongodb::li::email-email","meta":{"raw":"**Email**"}},{"type":"list-item","id":"unique-id","title":"Unique ID","content":"Unique ID","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise-usage-without-mongodb::li::unique-id-unique-id","meta":{"raw":"**Unique ID**"}},{"type":"list-item","id":"integration-ids","title":"Integration IDs","content":"Integration IDs","link":"https://cobrowsingapi.com/docs/on-premise/quick-start#what-doesnt-work-on-premise-usage-without-mongodb::li::integration-ids-integration-ids","meta":{"raw":"**Integration IDs**"}}],"meta":{"ordered":false}}]}]}]},"https://cms-cdn.cobrowsingapi.com/www/data/docs-index-mkzu59nx-4e6973d9.json":[{"slug":"getting-started/how-it-works","title":"How It Works","order":1,"categoryOrder":1,"segmentOrders":[1,1],"root_link":true},{"slug":"getting-started/what-data-does-upscope-store","title":"What Data Does Upscope Store?","order":2,"categoryOrder":1,"segmentOrders":[1,2]},{"slug":"getting-started","title":"Getting Started","order":999,"categoryOrder":1,"segmentOrders":[1,999],"render":false},{"slug":"sdk/web/installation","title":"Installation","order":1,"categoryOrder":2,"segmentOrders":[2,1,1]},{"slug":"sdk/web/configuration-options","title":"Configuration Options","order":2,"categoryOrder":2,"segmentOrders":[2,1,2]},{"slug":"sdk/web/sdk-functions","title":"SDK Functions","order":3,"categoryOrder":2,"segmentOrders":[2,1,3]},{"slug":"sdk/web/listening-for-events","title":"Listening for Events","order":4,"categoryOrder":2,"segmentOrders":[2,1,4]},{"slug":"sdk/web/translations","title":"Multi-Language Support","order":5,"categoryOrder":2,"segmentOrders":[2,1,5]},{"slug":"sdk/web","title":"Web SDK","order":999,"categoryOrder":2,"segmentOrders":[2,1,999],"render":false},{"slug":"sdk/ios/installation","title":"Installation","order":1,"categoryOrder":2,"segmentOrders":[2,2,1]},{"slug":"sdk/ios/configuration-options","title":"Configuration Options","order":2,"categoryOrder":2,"segmentOrders":[2,2,2]},{"slug":"sdk/ios/sdk-functions","title":"SDK Functions","order":3,"categoryOrder":2,"segmentOrders":[2,2,3]},{"slug":"sdk/ios/listening-for-events","title":"Listening for Events","order":4,"categoryOrder":2,"segmentOrders":[2,2,4]},{"slug":"sdk/ios","title":"iOS SDK","order":999,"categoryOrder":2,"segmentOrders":[2,2,999]},{"slug":"sdk/android/installation","title":"Installation","order":1,"categoryOrder":2,"segmentOrders":[2,3,1]},{"slug":"sdk/android/configuration-options","title":"Configuration Options","order":2,"categoryOrder":2,"segmentOrders":[2,3,2]},{"slug":"sdk/android/sdk-functions","title":"SDK Functions","order":3,"categoryOrder":2,"segmentOrders":[2,3,3]},{"slug":"sdk/android/listening-for-events","title":"Listening for Events","order":4,"categoryOrder":2,"segmentOrders":[2,3,4]},{"slug":"sdk/android","title":"Android SDK","order":999,"categoryOrder":2,"segmentOrders":[2,3,999]},{"slug":"sdk/element-masking","title":"Element Masking","order":999,"categoryOrder":2,"segmentOrders":[2,999]},{"slug":"sdk/identifying-the-visitor","title":"Identifying the Visitor","order":999,"categoryOrder":2,"segmentOrders":[2,999]},{"slug":"sdk","title":"SDK","order":999,"categoryOrder":2,"segmentOrders":[2,999],"root_link":true},{"slug":"sdk/the-lookup-code","title":"The Lookup Code","order":999,"categoryOrder":2,"segmentOrders":[2,999]},{"slug":"rest-api/authentication","title":"Authentication","order":1,"categoryOrder":3,"segmentOrders":[3,1]},{"slug":"rest-api/api-endpoints","title":"API Endpoints","order":2,"categoryOrder":3,"segmentOrders":[3,2]},{"slug":"rest-api/object-types","title":"Object Types","order":3,"categoryOrder":3,"segmentOrders":[3,3]},{"slug":"rest-api/better-searching","title":"Better Searching","order":5,"categoryOrder":3,"segmentOrders":[3,5]},{"slug":"rest-api/embedded-session-control","title":"Embedded Session Control","order":6,"categoryOrder":3,"segmentOrders":[3,6]},{"slug":"rest-api","title":"REST API","order":999,"categoryOrder":3,"segmentOrders":[3,999],"render":false,"root_link":true},{"slug":"on-premise","title":"On Premise","order":999,"categoryOrder":4,"segmentOrders":[4,999]},{"slug":"on-premise/quick-start","title":"Quick Start","order":999,"categoryOrder":4,"segmentOrders":[4,999]},{"slug":"on-premise/rest-api-on-premise","title":"REST API (on premise)","order":999,"categoryOrder":4,"segmentOrders":[4,999]}]};