Google Drive
Content & assetsGoogle Drive
Let end-users pull assets from their own Google Drive. MailKaro uses the Google Picker with the non-restricted drive.file scope, so there's no Google verification or CASA audit, the app only ever sees the files the user picks.
Zero-config#
The simplest setup uses MailKaro's hosted connect page and default client id, the integrator does no Google setup:
<EmailEditor googleDrive={true} />
// or, lower level:
<EmailEditor config={{ assets: { googleDrive: true } }} />In the drop-in editor, googleDrive={true} opens a popup on ${apiBaseUrl}/drive/connect, Google auth + the Picker run there, on MailKaro's origin, so your domain never needs to be whitelisted in Google. Picked files are auto-shared “anyone with link” and returned as stable CDN URLs. The OAuth token stays on MailKaro's origin; only the finished public URLs come back.
Configuration#
googleDrive?:
| boolean
| {
clientId?: string; // your own OAuth Web client (inline mode)
developerKey?: string; // browser API key for the Picker (non-secret)
appId?: string; // Google Cloud project NUMBER
connectUrl?: string; // hosted connect page (Approach B popup)
scope?: string; // default: drive.file
}Bring your own Google project (inline)#
<EmailEditor config={{ assets: {
googleDrive: {
clientId: "1234-abc.apps.googleusercontent.com", developerKey: "AIza…", appId: "490986048072"
}
}}} />Inline mode runs the Picker directly on your page, so your origin must be listed in the OAuth client's Authorized JavaScript origins, and the Google Picker API must be enabled.
Hosted connect popup (your own domain)#
<EmailEditor config={{ assets: {
googleDrive: { connectUrl: "https://api.mailkaro.com/drive/connect" }
}}} />