Skip to main content

Google Drive

You can add your existing Google Drive storage as a datasource in PixelBin. This allows you to use PixelBin's real-time file delivery and transformation features on all existing files stored in the drive.

For PixelBin to be able to access your Google Drive storage, you will need to create a new Google Service Account and share a folder within your Google Drive with that service account, that you wish to integrate with PixelBin. This tutorial will help you do that.


Setting up Google Drive

info

In case you find the following instructions invalid/outdated, you can refer to Google's official, albeit more verbose instructions on these pages:

  1. Enabling the Google Drive API.
  2. Creating and managing service accounts.
  3. Creating and managing service account keys.
  4. Share a drive folder with the service account.

1. Enable Drive API

You need to enable Google Drive API to access it through the SDK.

  1. In the Cloud Console, go to the Google Drive API page.
  2. Make sure your project is selected.
  3. Click on Enable.

2. Create a service account

The service account is a separate virtual identity that will be used by PixelBin to access the files in your drive's folder.

  1. In the Cloud Console, go to the Service Accounts page. Go to the Service Accounts page.
  2. Click Select a project, choose your project, and click Open.
  3. Click Create a Service Account.
  4. Enter a service account name (e.g. for-pixelbin-access), and an optional description.
  5. Click Save.

3. Create access keys for the Service Account

We need to create access keys that will be used by PixelBin to authenticate itself to the Google Cloud Storage APIs.

  1. In the Cloud Console, go to the Service Accounts page. Go to the Service Accounts page.
  2. Click Select a project, choose a project, and click Open.
  3. Click on the service account that we created in Step 1.
  4. On the page for the service account, click on the Add key button in the Keys section.
  5. Select JSON as the key type and click Create. This will download a JSON file.
  6. You will need to paste the contents of this file to the PixelBin dashboard.
info

Make sure to store this file securely, as it cannot be downloaded again.

4: Share drive folder with the Service Account

We need to share a folder with the service account which will be accessed by PixelBin.

  1. Go to Google Drive.
  2. Right-click the folder you want to share.
  3. Click on the Share menu item.
  4. Type the service account's email address.
  5. Click Done.
caution

To avoid inconsistencies, only share one folder with one service account and try to avoid having more than one file with the same name in a single folder.


Configure Datasource

  1. After entering basic details for the datasource, choose Google Drive from the set of datasource types.
  2. Copy-paste the contents of the keyFile.json you get from your created service account.
  3. Click Save.
note

We do not start copying files from your storage as soon as you add the datasource. Instead, we will fetch the particular file when you request it through the PixelBin URL endpoint. The files accessed from this origin will not appear in your Storage library.

Transform and enhance your images using our powerful AI technology. Organize your images in more efficient manner and our extensible APIs enables seamless integration with your system unleashing the power of our platform. Join the large community of users who use PixelBin to transform their image libraries and achieve excellent performance

Is this page useful?