JBrowse 2 · Linear Genome View examples

Internet accounts (authentication)

A per-track fetch override, usually a bearer token.

DropboxOAuthInternetAccount and GoogleDriveOAuthInternetAccount do not work in an embedded view, which cannot control redirects and popups. Run the OAuth flow in your host app and pass the token to ExternalTokenInternetAccount.

Show source · 38 linesHide source · 38 lines
import { LinearGenomeView } from '@jbrowse/react-linear-genome-view2'

export default function InternetAccounts() {
  return (
    <LinearGenomeView
      assembly={{
        name: 'volvox',
        uri: 'https://jbrowse.org/genomes/volvox/volvox.2bit',
      }}
      tracks={[
        {
          type: 'QuantitativeTrack',
          trackId: 'google_bigwig',
          name: 'Google Drive BigWig',
          assemblyNames: ['volvox'],
          adapter: {
            type: 'BigWigAdapter',
            bigWigLocation: {
              locationType: 'UriLocation',
              uri: 'https://www.googleapis.com/drive/v3/files/1PIvZCOJioK9eBL1Vuvfa4L_Fv9zTooHk?alt=media',
              internetAccountId: 'manualGoogleEntry',
            },
          },
        },
      ]}
      view={{ loc: 'ctgA:1105..1221' }}
      internetAccounts={[
        {
          type: 'ExternalTokenInternetAccount',
          internetAccountId: 'manualGoogleEntry',
          name: 'Google Drive Manual Token Entry',
          description: 'Manually enter a token to access Google Drive files',
          tokenType: 'Bearer',
        },
      ]}
    />
  )
}