Skip to content

Commit a0240e5

Browse files
committed
docs: Updated readme for ibm-credentials.env to keep consistent with the other sdks
1 parent b9bfd3f commit a0240e5

File tree

2 files changed

+32
-15
lines changed

2 files changed

+32
-15
lines changed

README.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,21 @@ void Start()
179179
}
180180
```
181181

182-
### ibm-credentials.env
183-
You can create an ibm-credentials.env file for authentication. This has the basic format
184-
```
185-
VISUAL_RECOGNITION_APIKEY=<visual-recognition-apikey>
186-
VISUAL_RECOGNITION_URL=<visual-recognition-service-url>
187-
ASSISTANT_APIKEY=<assistant-apikey>
188-
ASSISTANT_URL=<assistant-service-url>
189-
```
190-
The SDK will search for this file in the following order
191-
- Path specified by environmental variable `IBM_CREDENTIALS_FILE`
192-
- System home directory
193-
- Top level of the project directory
182+
### Supplying credentials
183+
184+
There are two ways to supply the credentials you found above to the SDK for authentication.
185+
186+
#### Credential file (easier!)
187+
188+
With a credential file, you just need to put the file in the right place and the SDK will do the work of parsing it and authenticating. You can get this file by clicking the **Download** button for the credentials in the **Manage** tab of your service instance.
189+
190+
The file downloaded will be called `ibm-credentials.env`. This is the name the SDK will search for and **must** be preserved unless you want to configure the file path (more on that later). The SDK will look for your `ibm-credentials.env` file in the following places (in order):
191+
192+
- Your system's home directory
193+
- The top-level directory of the project you're using the SDK in
194+
195+
As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following:
194196

195-
Using a `ibm-credentials.env` file you can easily instantiate and authenticate a service. If you are using an IAM Apikey you will need to invoke this using a coroutine to wait for the authorization token.
196197
```cs
197198
public IEnumerator ExampleAutoService()
198199
{
@@ -205,7 +206,23 @@ public IEnumerator ExampleAutoService()
205206

206207
var listWorkspacesResult = assistantService.ListWorkspaces();
207208
}
208-
```
209+
```
210+
211+
And that's it!
212+
213+
If you're using more than one service at a time in your code and get two different `ibm-credentials.env` files, just put the contents together in one `ibm-credentials.env` file and the SDK will handle assigning credentials to their appropriate services.
214+
215+
If you would like to configure the location/name of your credential file, you can set an environment variable called `IBM_CREDENTIALS_FILE`. **This will take precedence over the locations specified above.** Here's how you can do that:
216+
217+
```bash
218+
export IBM_CREDENTIALS_FILE="<path>"
219+
```
220+
221+
where `<path>` is something like `/home/user/Downloads/<file_name>.env`.
222+
223+
#### Manually
224+
225+
If you'd prefer to set authentication values manually in your code, the SDK supports that as well. The way you'll do this depends on what type of credentials your service instance gives you.
209226

210227
## Callbacks
211228
Success and failure callbacks are required. You can specify the return type in the callback.

Scripts/Utilities/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static class Config
8484
/// <summary>
8585
/// Default time in seconds after which a call should timeout.
8686
/// </summary>
87-
public static float Timeout = 60f;
87+
public static float Timeout = 360f;
8888
}
8989

9090
/// <summary>

0 commit comments

Comments
 (0)