Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzware authored Feb 21, 2019
1 parent ec275d1 commit d156e15
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Build | [![CircleCI](https://circleci.com/gh/Opteo/google-ads-node.svg?style=shield&circle-token=ab3cda2c83e0a13712c96c088871e16ead2b78c7)](https://circleci.com/gh/Opteo/google-ads-node) |
| Release | ![Release](https://img.shields.io/github/release/opteo/google-ads-node.svg) |

This library is a minimal, low-level implementation for calling the Google Ads API with gRPC Protocol Buffers. For a more feature complete and easier to use library, try our [Javascript client library](https://github.com/opteo/google-ads-api).
**Note:** This library is a minimal, low-level implementation for calling the Google Ads API with gRPC Protocol Buffers. For a more feature complete and easier to use library, try our [Javascript client library](https://github.com/opteo/google-ads-api).

## Features
- Fully matches the lastest [Google Ads API documentation](https://developers.google.com/google-ads/api/reference/rpc/)
Expand Down Expand Up @@ -79,6 +79,31 @@ example();

```

## Usage

### Authentication

#### 1. No internal authentication
A valid Google Ads `access_token` must be provided. This usage depends on the `access_token` being refreshed and generated outside of the client. If the token isn't valid, an `UNAUTHENTICATED` error will be thrown. It's recommended to follow the [instructions here for generating tokens](https://developers.google.com/google-ads/api/docs/oauth/overview).
```javascript
const client = new GoogleAdsClient({
developer_token: "<DEVELOPER_TOKEN>",
access_token: "<ACCESS_TOKEN>",
});
```

#### 2. Token generation and refresh handling
This approach, which is recommended, internally handles access token generation and refreshing. A valid `client_id`, `client_secret` and `refresh_token` must be provided.
```javascript
const client = new GoogleAdsClient({
client_id: "<CLIENT_ID>",
client_secret: "<CLIENT_SECRET>",
refresh_token: "<REFRESH_TOKEN>",
developer_token: "<DEVELOPER_TOKEN>",
});
```


## Contributing

### Protocol Buffers
Expand Down

0 comments on commit d156e15

Please sign in to comment.