Resource summary for Google Picker API

The Google Picker API uses a builder pattern with PickerBuilder and Picker.

const picker = new google.picker.PickerBuilder()
    .setOAuthtoken('TOKEN_FOR_USER')
    .setAppId('1234567890')  // Cloud Project number
    .addView(google.picker.ViewId.DOCS)
    .setCallback((data) => {
      console.log(data);
    })
    .build();

picker.setVisible(true);

Classes

Name Description
DocsUploadView Use DocsUploadView to upload files to Google Drive.
DocsView Use DocsView to select files from Google Drive.
Picker Picker is the top level object representing the UI action with the user. These objects are not created directly, but instead use the PickerBuilder class.
PickerBuilder PickerBuilder is used to create Picker objects. Except where noted otherwise, the return type of methods below is of type PickerBuilder, allowing you to chain one call after another.
ResourceId ResourceId is a utility class for generating resource IDs for documents.
View An abstract class for all views.
ViewGroup A ViewGroup is a visual grouping of views in the navigation pane.

Enums

Name Description
Action The action type for the ResponseObject.
Audience Audience is an enumerated type used to describe the audience of the DocumentObject.
DocsViewMode DocsViewMode is an enumerated type for displaying data within a DocsView. Use these values in calls to DocsView.setMode.
Document Document is an enumerated type used to describe the fields of a DocumentObject.
Feature Feature is an enumerated type, for turning on/off features for various views. Use these values in calls to PickerBuilder.enableFeature and PickerBuilder.disableFeature.
Response Response is an enumerated type used to describe the fields of a ResponseObject.
ServiceId ServiceId is an enumerated type used to describe the service the item was selected from.
Thumbnail Thumbnail is an enumerated type describing the fields of a ThumbnailObject.
Type The type of the selected item.
ViewId ViewId is an enumerated type for the various views available in the Picker. Use these values in calls to DocsView and PickerBuilder.
ViewToken ViewToken is an enumerated type used to describe the elements of a ResponseObject.viewToken.

Interfaces

Name Description
DocumentObject DocumentObject is an interface describing the attributes of a selected item.
ResponseObject The response object passed to the callback method.
ThumbnailObject ThumbnailObject is an interface describing the attributes of a photo or video.

Type aliases

Name Description
Locales The supported ISO 639 language codes for PickerBuilder.setLocale.
ParentDocumentObject ParentDocumentObject is an interface describing the attributes of a parent folder for a selected item.