Skip to content

Commit fbfff57

Browse files
committed
added credential instructions to readme, revised visual recognition readme to use apikey instead of username and password
1 parent dddc655 commit fbfff57

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Ensure that you have the following prerequisites:
2121

2222
* An IBM Bluemix account. If you don't have one, [sign up][bluemix_registration].
2323
* [Unity][get_unity]. You can use the **free** Personal edition.
24-
* Change the build settings in Unity (**File > Build Settings**) to any platform except for web player. The Watson Developer Cloud Unity SDK does not support Unity Web Player.
24+
* Change the build settings in Unity (**File > Build Settings**) to any platform except for web player/Web GL. The Watson Developer Cloud Unity SDK does not support Unity Web Player.
2525
* A chm reader if you would like to access SDK Documentation (optional).
2626

2727
## Getting the Watson SDK and adding it to Unity
@@ -50,8 +50,37 @@ To create instances of Watson services and their credentials, follow the steps b
5050
5. Click **View credentials** to access your credentials.
5151
1. Your service credentials can be used to instantiate Watson Services within your application. Most services also support tokens which you can instantiate the service with as well.
5252

53+
The credentials for each service contain either a `username`, `password` and endpoint `url` **or** an `apikey` and endpoint `url`.
54+
5355
**WARNING:** You are responsible for securing your own credentials. Any user with your service credentials can access your service instances!
5456

57+
## Authentication
58+
Before you can use a service, it must be authenticated with the service instance's `username`, `password` and `url`.
59+
60+
```cs
61+
using IBM.Watson.DeveloperCloud.Services.Conversation.v1;
62+
using IBM.Watson.DeveloperCloud.Utilities;
63+
64+
void Start()
65+
{
66+
Credentials credentials = new Credentials(<username>, <password>, <url>);
67+
Conversation _conversation = new Conversation(credentials);
68+
}
69+
```
70+
71+
For services that authenticate using an apikey, you can instantiate the service instance using a `Credential` object with an `apikey` and `url`.
72+
73+
```cs
74+
using IBM.Watson.DeveloperCloud.Services.VisualRecognition.v3;
75+
using IBM.Watson.DeveloperCloud.Utilities;
76+
77+
void Start()
78+
{
79+
Credentials credentials = new Credentials(<apikey>, <url>);
80+
VisualRecognition _visualRecognition = new VisualRecognition(credentials);
81+
}
82+
```
83+
5584
## Watson Services
5685
To get started with the Watson Services in Unity, click on each service below to read through each of their `README.md`'s and their codes.
5786
* [Alchemy Language](/Scripts/Services/AlchemyAPI/v1)

Scripts/Services/VisualRecognition/v3/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using IBM.Watson.DeveloperCloud.Utilities;
1212

1313
void Start()
1414
{
15-
Credentials credentials = new Credentials(<username>, <password>, <url>);
15+
Credentials credentials = new Credentials(<apikey>, <url>);
1616
VisualRecognition _visualRecognition = new VisualRecognition(credentials);
1717
}
1818
```

0 commit comments

Comments
 (0)