---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# cabrillo.camera - Client

# cabrillo.camera - Client {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Cabrillo JS
camera functions to provide camera access for bar code scanning.

## cabrillo.camera - getBarcode() {#ariaid-title2}

Provides a standard interface for scanning bar codes. Use this to present a bar code
scanner and capture scanned result.
Supported bar code types.

* 1D bar codes: EAN-13, EAN-8, UPC-A, UPC-E, Code-39, Code-93, Code-128, ITF
* 2D bar codes: QR Code, Data Matrix, PDF-417, AZTEC
{#CC-getBarcode__ul_uls_1gf_wbb}
{#CC-getBarcode__table_ah1_tff_wbb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#CC-getBarcode__table_ah1_tff_wbb} {#CC-getBarcode__table_bh1_tff_wbb__entry__2}

| Type | Description |
|-|-|
| promise | Resolves to a bar code string, or if the operation fails, an error. |
[Table 2. Returns]

{#CC-getBarcode__table_bh1_tff_wbb}  

    cabrillo.camera.getBarcode().then(function(barcode) {
        if (barcode) {
            console.log('Scanned barcode.', barcode);
        } else {
            console.log('User cancelled scanning barcode.');
        }
    }, function(error) {
        console.log('Failed to scan barcode.', error);
    });


