Skip to content

Commit 8947580

Browse files
committed
docs: readme updates for major release
1 parent 72bd392 commit 8947580

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ npm install ibm-watson
7373

7474
## Usage
7575

76+
```ts
77+
import DiscoveryV1 from 'ibm-watson/discovery/v1';
78+
import { IamAuthenticator } from 'ibm-watson/auth';
79+
80+
const discoveryClient = new DiscoveryV1({
81+
authenticator: new IamAuthenticator({ apikey: '{apikey}' })
82+
version: '{version}',
83+
})
84+
85+
// ...
86+
87+
```
88+
7689
The [examples][examples] folder has basic and advanced examples. The examples within each service assume that you already have [service credentials](#getting-credentials).
7790

7891
### Client-side usage
@@ -91,7 +104,7 @@ Watson services are migrating to token-based Identity and Access Management (IAM
91104
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
92105
- If you're using a Watson service on ICP, you'll need to authenticate in [a specific way](#icp).
93106

94-
To specify the type of authentication to use, there is an optional parameter called `authentication_type`. Possible values are `iam`, `basic`, and `icp4d`.
107+
Authentication is accomplished using dedicated authenticators for each authentication scheme. Import authenticators from `ibm-watson/auth` or rely on externally-configured credentials which will be read from a credentials file or environment variables.
95108

96109
### Getting credentials
97110

0 commit comments

Comments
 (0)