If you have a bitly account username and password:
$bitly = Bitly::usernamePassword($username, $password);
If you have an access token (you can get one from https://bitly.com/a/oauth_apps):
$bitly = Bitly::accessToken($accessToken);
If you want to log the user in using OAuth:
$bitly = Bitly::authorize($clientId, $clientSecret, $projectUrl, $state);
Return the click rate for content containing 'obama':
$realtimeClickrates = $bitly->shorten('https://github.com/Jleagle/bitly-api-client');