@@ -18,7 +18,7 @@ npm install sightengine --save
1818
1919You will need your API USER and API SECRET to initialize the client. You can find both of them on your Sightengine account.
2020``` javascript
21- var sightengine = require (' sightengine' )(' YOUR_API_USER ' , ' YOUR_API_SECRET ' );
21+ var sightengine = require (' sightengine' )(' {api_user} ' , ' {api_secret} ' );
2222```
2323
2424# Using Promises
@@ -33,14 +33,14 @@ Several moderation engines are available for you to choose from (nudity detectio
3333
3434``` javascript
3535// Detect nudity in an image
36- sightengine .check ([' nudity' ]).image (' http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg' ).then (function (result ) {
36+ sightengine .check ([' nudity' ]).set_url (' http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg' ).then (function (result ) {
3737 // The result of the API
3838}).catch (function (err ) {
3939 // Error
4040});
4141
4242// Detect nudity, weapons, alcohol, drugs and faces in an image, along with image properties and type
43- sightengine .check ([' nudity' , ' type' , ' properties' ,' wad' ,' face' ]).image (' http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg' ).then (function (result ) {
43+ sightengine .check ([' nudity' , ' type' , ' properties' ,' wad' ,' face' ]).set_url (' http://img09.deviantart.net/2bd0/i/2009/276/c/9/magic_forrest_wallpaper_by_goergen.jpg' ).then (function (result ) {
4444 // The result of the API
4545}).catch (function (err ) {
4646 // Error
@@ -50,14 +50,31 @@ sightengine.check(['nudity', 'type', 'properties','wad','face']).image('http://i
5050## Moderate a local image:
5151``` javascript
5252// Detect nudity in an image
53- sightengine .check ([' nudity' ]).image (' /full/path/to/image.jpg' ).then (function (result ) {
53+ sightengine .check ([' nudity' ]).set_file (' /full/path/to/image.jpg' ).then (function (result ) {
5454 // The result of the API
5555}).catch (function (err ) {
5656 // Error
5757});
5858
5959// Detect nudity, weapons, alcohol, drugs and faces in an image, along with image properties and type
60- sightengine .check ([' nudity' , ' type' , ' properties' ,' wad' ,' face' ]).image (' /full/path/to/image.jpg' ).then (function (result ) {
60+ sightengine .check ([' nudity' , ' type' , ' properties' ,' wad' ,' face' ]).set_file (' /full/path/to/image.jpg' ).then (function (result ) {
61+ // The result of the API
62+ }).catch (function (err ) {
63+ // Error
64+ });
65+ ```
66+
67+ ## Moderate a binary image:
68+ ``` javascript
69+ // Detect nudity in an image
70+ sightengine .check ([' nudity' ]).set_bytes (binary_image).then (function (result ) {
71+ // The result of the API
72+ }).catch (function (err ) {
73+ // Error
74+ });
75+
76+ // Detect nudity, weapons, alcohol, drugs and faces in an image, along with image properties and type
77+ sightengine .check ([' nudity' , ' type' , ' properties' ,' wad' ,' face' ]).set_bytes (binary_image).then (function (result ) {
6178 // The result of the API
6279}).catch (function (err ) {
6380 // Error
0 commit comments