Skip to content
← Public packages

@kody/dropbox

Reusable Dropbox OAuth helpers for account, metadata, search, file transfer, sharing, and generic API requests.

src/smoke-test.ts

18 lines · 600 B · TypeScript
import getCurrentAccount from './get-current-account.ts'

/**
 * Verify Dropbox OAuth access without returning account PII.
 * @example
 * import smokeTest from 'kody:@kody/dropbox/smoke-test'
 * const result = await smokeTest()
 */
export default async function smokeTest() {
	const account = await getCurrentAccount()
	return {
		ok: true,
		hasAccountId: typeof account.account_id === 'string' && account.account_id.length > 0,
		hasDisplayName:
			typeof account.name?.display_name === 'string' && account.name.display_name.length > 0,
		accountType: account.account_type?.['.tag'] ?? null,
	}
}