PDF Web Viewer
    Preparing search index...

    Interface IGoogleDriveConfig

    Google Drive integration configuration.

    When supplied, the viewer shows a "Google Drive" card on the empty ("home") screen with a Connect action. The library performs the OAuth flow itself (via Google Identity Services) using the integrator-provided client ID and lists the user's recent Drive PDFs / lets them browse folders.

    The integrator must create an OAuth 2.0 Web application client ID in the Google Cloud console, enable the Google Drive API, and add the app origin to the client's "Authorized JavaScript origins". Google Identity Services is loaded at runtime from https://accounts.google.com/gsi/client, so the host page's CSP must allow that script.

    interface IGoogleDriveConfig {
        clientId: string;
        isSaveAllowed?: AllowSaveGuard;
        scopes?: string[];
    }
    Index

    Properties

    clientId: string

    Google OAuth 2.0 Web-application client ID. Required.

    isSaveAllowed?: AllowSaveGuard

    Optional guard for saving into Google Drive. The upload itself is performed by the library; this only decides whether a given document may be written to a given target. Omit it to allow every save. See AllowSaveGuard.

    scopes?: string[]

    OAuth scopes requested at connect time. Defaults to ['https://www.googleapis.com/auth/drive'] (full access — browse, open and save back; a restricted scope that requires Google app verification for production use). Configure ['https://www.googleapis.com/auth/drive.readonly'] for a read-only integration: the drive then stops offering itself as a save target.