Cobrowse.io Docs
  • Getting started
  • SDK Installation
    • Web
    • iOS
    • Android
    • React Native
    • Flutter
    • .NET Mobile
    • macOS
    • Windows
  • SDK Features
    • Account config
    • Identify your devices
    • Use 6-digit codes
    • Redact sensitive data
    • Viewing PDFs
    • Universal Cobrowse
    • Customize the interface
      • Active session controls
      • 6-digit code screen
      • User consent dialog
      • Remote control consent dialog
      • Full device consent dialog
      • Localization / translation
    • Initiate sessions with push
    • Listening for events
    • Full device capabilities
      • Full device screen sharing
      • Full device remote control
      • Managing full device mode
    • Advanced configuration
      • Starting and stopping the SDK
      • Declaring capabilities
      • Intercepting mobile SDK network requests
      • Web
        • IFrames support
        • IE 11 polyfills
        • Cross-domain session support
        • Ignore Views
      • iOS
        • Alternate render method
        • Custom touch handling
      • Android
        • Backporting TLS to older Android versions
  • Agent-side integrations
    • Agent-side overview
    • Platform integrations
      • Zendesk
      • Salesforce
        • Migrating from legacy to v2
        • Salesforce (Legacy)
      • Genesys
        • Genesys Cloud
        • Engage Workspace Web Edition (WWE)
        • Engage Workspace Desktop Edition (WDE)
      • Intercom
      • Freshworks
      • Talkdesk
      • NICE
    • Custom integrations
    • Agent SDK
      • API Reference
      • Sample code snippets
    • Authentication (JWTs)
      • JWT Policies
    • Authentication (SAML 2.0)
    • IFrame embeds
  • Enterprise self-hosting
    • Self-hosting overview
    • Docker Compose
    • Helm chart
      • Image Pull Secret
      • Environment Variables
      • Optional recording components
      • Pod Annotations
    • AWS terraform
      • AWS metrics configuration
    • Azure terraform
      • Azure metrics configuration
    • GCP terraform
      • GCP metrics configuration
    • Sizing guidelines
    • Running your instance
      • Adding a superuser
      • Limiting account creation
      • Limiting magic link recipients
      • Configuring SMTP
      • Managing your deployment
    • Monitoring your instance
      • Available metrics
      • Self-Hosted Prometheus
    • Advanced configuration
      • Air gap configuration
      • Pin web SDK version
      • L7 firewall configuration
      • Docker proxy configuration
    • Troubleshooting
Powered by GitBook
On this page

Was this helpful?

  1. SDK Features

Use 6-digit codes

Cobrowse does not require any visible UI presented to the user but there is the option to present a UI that generates a 6-digit code. Learn more.

PreviousIdentify your devicesNextRedact sensitive data

Last updated 3 months ago

Was this helpful?

By default, Cobrowse does not require any visible UI presented to the user. It will exist in the background of your app, and only activate when agents initiate a new session.

You may optionally present a UI in your app that enables users to generate 6-digit codes. Users may then read a code over the phone or in chat, and agents can use the 6-digit code to initiate the Cobrowse session.

Important: 6-digit codes expire after approximately 20 minutes, so it's best practice to generate a code only when a user wants to start a session.

To generate a 6-digit code in your integration you can use the following APIs. Once you have generated the code you can display it to the user in your own UI. You should only generate a code when a user needs it as they expire shortly after creation.

// ensure Cobrowse is loaded
CobrowseIO.client().then(function() {
    // create a code a display it to the user using your own UI
    // ONLY GENERATE CODE WHEN NEEDED. DO NOT GENERATE CODE ON PAGE LOAD.
    CobrowseIO.createSessionCode().then(function(code) {
       console.log('your code is', code);
    });
});

Swift

CobrowseIO.instance().createSession { error, session in
    guard error == nil, let code = session?.code()
        else { return }
    
    print(code)
}

Objective-C

[CobrowseIO.instance createSession:^(NSError * err, CBIOSession * session) {
    if (err) NSLog(@"Failed to create code")
    else NSLog(@"%@", session.code);
}];

CobrowseIO.instance().createSession((err, session) -> {
    if (err != null) Log.w("App", "Failed to create code");
    else if (session != null) Log.i("App", "Session code " + session.code());
});
const session = await CobrowseIO.createSession()
console.log('Your 6 digit code is', session.code)
Session session = await CobrowseIO.instance.createSession();
log('Your session code: ${session.code}');
CobrowseIO.Instance.CreateSession((Exception err, ISession session) => {
    if (err != null) Debug.WriteLine("Failed to create a code");
    else if (session != null) Debug.WriteLine("Session code " + session.Code);
});
Session session = await CobrowseIO.Instance.CreateSession();
Console.WriteLine("Code: {0}", session.Code);

If you are only using 6 digit codes to start Cobrowse sessions in your implementation, you can prevent the SDK registering in your Cobrowse account until a screen sharing session is required. See the documentation on preventing automatic registration.

You can monitor changes in the state of the session using the Cobrowse delegate methods to listen for events:

To see some code samples for how to build a custom UI for your platform see:

Starting and stopping the SDK
Listening for events
6-digit code screen