You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Breaking: prefer programatic (user-supplied) credentials over bluemix-provided ones (VCAP_SERVICES)
4
+
* New preferred method of instantiating services: `new watson.PersonalityInsightsV2({/*...*/});` instead of `watson.personality_insights({/*...*/});`. Older method still works
5
+
* Restructured code to support client-side usage via tools such as Browserify and Webpack. Most services support CORS; this will be documented and the remaining service teams will be nagged.
6
+
* Added a changelog to capture both major breaking changes and smaller
7
+
8
+
9
+
## Breaking Changes for v1.0
10
+
11
+
Several breaking changes were introduced with the v1.0.0 release:
12
+
13
+
* Experimental and Beta services now require the appropriate tag to be added to their version:
14
+
* Concept Expansion `v1` is now `v1-beta`
15
+
* Question and Answer `v1` is now `v1-beta`
16
+
* Relationship Extraction `v1` is now `v1-beta`
17
+
* Tone Analyzer `v3` is now `v3` (latest) or `v3-beta` (compatibility with old Beta plan)
18
+
* Visual Insights `v1` is now `v1-experimental`
19
+
* Visual Recognition `v1` is now `v1-beta`
20
+
* Speech to Text gained a new `createRecognizeStream()` method replacing the existing live streaming methods with a simpler Read/Write stream.
21
+
The older methods are still available in v1.0 but each log a deprecation warning (unless `{silent: true}` is passed in) and will be removed from a future release.
22
+
The affected methods are:
23
+
*`recognizeLive()`
24
+
*`observeResult()`
25
+
*`getRecognizeStatus()`
26
+
* The Document Conversion API has been reduced to a single `convert()` method; it no longer offers batch conversion or cloud storage of files.
27
+
* Several deprecated services have been removed:
28
+
* Message Resonance
29
+
* Tone Analyzer v1 and v2 (replaced by v3)
30
+
* Search (replaced by Retrieve and Rank)
31
+
* Dropped support for node.js v0.10.x (For reference: the WDC Node.js SDK now officially support the latest 0.12, LTS, and Stable releases of Node.js.)
Copy file name to clipboardExpand all lines: README.md
+40-51Lines changed: 40 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Node client library to use the [Watson Developer Cloud][wdc] services, a collect
11
11
APIs and SDKs that use cognitive computing to solve complex problems.
12
12
13
13
## Table of Contents
14
-
*[Breaking Changes for v1.0](#breaking-changes-for-v10)
14
+
*[Major Changes for v2](#breaking-changes-for-v2)
15
15
*[Installation](#installation)
16
16
*[Usage](#usage)
17
17
*[Getting the Service Credentials](#getting-the-service-credentials)
@@ -44,30 +44,44 @@ APIs and SDKs that use cognitive computing to solve complex problems.
44
44
*[License](#license)
45
45
*[Contributing](#contributing)
46
46
47
-
## Breaking Changes for v1.0
48
-
49
-
Several breaking changes were introduced with the v1.0.0 release:
50
-
51
-
* Experimental and Beta services now require the appropriate tag to be added to their version:
52
-
* Concept Expansion `v1` is now `v1-beta`
53
-
* Question and Answer `v1` is now `v1-beta`
54
-
* Relationship Extraction `v1` is now `v1-beta`
55
-
* Tone Analyzer `v3` is now `v3` (latest) or `v3-beta` (compatibility with old Beta plan)
56
-
* Visual Insights `v1` is now `v1-experimental`
57
-
* Visual Recognition `v1` is now `v1-beta`
58
-
* Speech to Text gained a new `createRecognizeStream()` method replacing the existing live streaming methods with a simpler Read/Write stream.
59
-
The older methods are still available in v1.0 but each log a deprecation warning (unless `{silent: true}` is passed in) and will be removed from a future release.
60
-
The affected methods are:
61
-
*`recognizeLive()`
62
-
*`observeResult()`
63
-
*`getRecognizeStatus()`
64
-
* The Document Conversion API has been reduced to a single `convert()` method; it no longer offers batch conversion or cloud storage of files.
65
-
* Several deprecated services have been removed:
66
-
* Message Resonance
67
-
* Tone Analyzer v1 and v2 (replaced by v3)
68
-
* Search (replaced by Retrieve and Rank)
69
-
* Dropped support for node.js v0.10.x (For reference: the WDC Node.js SDK now officially support the latest 0.12, LTS, and Stable releases of Node.js.)
70
47
48
+
## Major Changes for v2
49
+
50
+
***Breaking**: user-supplied credentials are now preferred over Bluemix-supplied credentials.
51
+
The order of preference is now:
52
+
53
+
1. User-supplied credentials passed to the service constructor
54
+
2. SERVICE_NAME_USERNAME/PASSWORD environment properties (or _API_KEY when appropriate)
55
+
3. Bluemix-supplied credentials (via the VCAP_SERVICES JSON-encoded environment property)
56
+
57
+
* Client-side support via [Browserify](http://browserify.org/)
58
+
59
+
`examples/browserify/` shows an example app that generates tokens server-side and uses the SDK client-side via browserify.
60
+
61
+
Note: Not all services currently support CORS, and therefore not all services can be used client-side.
62
+
Of those that do, most require an auth token to be generated server-side via the [Authorization Service](#authorization)
63
+
64
+
* New recommended method for instantiating services:
65
+
66
+
```js
67
+
var ToneAnalyzerV3 =require('watson-developer-cloud/tone-analyzer/v3');
68
+
69
+
var toneAnalyzer =newToneAnalyzerV3({/*...*/});
70
+
```
71
+
72
+
This was primarily done to enable smaller bundles for client-side usage, but also gives a small performance boost for server-side usage by only loading the portion of the library that is actually needed.
73
+
74
+
The following methods will also work, but cause the entire library to be loaded:
75
+
76
+
```js
77
+
// Alternate methods using the library.
78
+
// Not recommended, especially for client-side JS.
79
+
var watson =require('watson-developer-cloud');
80
+
81
+
var toneAnalyzer =newwatson.ToneAnalyzerV3({/*...*/});
82
+
83
+
var tone_analyzer =watson.tone_analyzer({version:'v3', /*...*/});
84
+
```
71
85
72
86
## Installation
73
87
@@ -88,7 +102,7 @@ credentials; the library will get them for you by looking at the `VCAP_SERVICES`
88
102
By default, [all requests are logged](http://www.ibm.com/watson/developercloud/doc/getting_started/gs-logging.shtml). This can be disabled of by setting the `X-Watson-Learning-Opt-Out` header when creating the service instance:
89
103
90
104
```js
91
-
var myInstance =watson.whatever_service({
105
+
var myInstance =newwatson.WhateverServiceV1({
92
106
/* username, password, version, etc... */
93
107
headers: {
94
108
"X-Watson-Learning-Opt-Out":"1"
@@ -226,32 +240,7 @@ authorization.getToken(params, function (err, token) {
226
240
```
227
241
228
242
### Concept Insights
229
-
Use the [Concept Insights][concept_insights] service to identify words in the
230
-
text that correspond to concepts in a Wikipedia graph.
231
-
232
-
```javascript
233
-
var watson =require('watson-developer-cloud');
234
-
235
-
var concept_insights =watson.concept_insights({
236
-
username:'<username>',
237
-
password:'<password>',
238
-
version:'v2'
239
-
});
240
-
241
-
var params = {
242
-
graph:'/graphs/wikipedia/en-20120601',
243
-
text:'IBM Watson won the Jeopardy television show hosted by Alex Trebek'
0 commit comments