Skip to content

Commit 0cbae74

Browse files
Update README.md
1 parent 35deb66 commit 0cbae74

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,24 @@ $ composer require bitbucket/client
2222

2323
## Usage
2424

25-
Usage documentation is coming soon!
25+
The main point of entry is the `Bitbucket\Client` class. Simply create a new instance of that, and you're good to go!
26+
27+
Practically, you will also want to set authentication details before calling any of the endpoint, however, this is not required to call endpoints for which authentication is not needed. We support logging in with an OAuth2 token, or with a username and password.
28+
29+
```php
30+
<?php
31+
32+
use Bitbucket\Client;
33+
34+
$c = new Client();
35+
36+
$c->authenticate(Client::AUTH_OAUTH_TOKEN, 'your-token-here');
37+
// $c->authenticate(Client::AUTH_HTTP_PASSWORD, 'your-username', 'your-password');
38+
39+
var_dump($c->currentUser()->show());
40+
```
41+
42+
As of time of writing (Monday 2nd April 2018), every endpoint available on the Bitbucket API 2.O is also available through this PHP client. I'd recommend looking through the Bitbucket documentation, and also the generated documentation available at https://bitbucketapi.github.io/Client/index.html.
2643

2744

2845
## Security

0 commit comments

Comments
 (0)