Skip to content

Commit 3fc2cbe

Browse files
Merge pull request #87 from ConvertAPI/feature/api-credentials
Switch to authorization header
2 parents 93c3f48 + c8956a3 commit 3fc2cbe

15 files changed

+24
-23
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ npm install convertapi --save
1616

1717
## Usage
1818

19-
The package needs to be configured with your account's secret key which is available at https://www.convertapi.com/a
19+
The package needs to be configured with your account's secret key or token which is available at https://www.convertapi.com/a
2020

2121
Require it with the key's value:
2222

2323
```javascript
24-
var convertapi = require('convertapi')('your-api-secret');
24+
var convertapi = require('convertapi')('your-api-secret-or-token');
2525
```
2626

2727
Or using ES modules:
2828

2929
```javascript
3030
import ConvertAPI from 'convertapi';
3131

32-
const convertapi = new ConvertAPI('your-api-secret');
32+
const convertapi = new ConvertAPI('your-api-secret-or-token');
3333
```
3434

3535
You can specify additional options, like proxy configuration and timeouts, when initializing the client:
3636

3737
```javascript
38-
var convertapi = require('convertapi')('your-api-secret', {
38+
var convertapi = require('convertapi')('your-api-secret-or-token', {
3939
conversionTimeout: 60,
4040
uploadTimeout: 60,
4141
downloadTimeout: 60,
@@ -54,7 +54,7 @@ var convertapi = require('convertapi')('your-api-secret', {
5454
If using ES module:
5555

5656
```javascript
57-
const convertapi = new ConvertAPI('your-api-secret', { conversionTimeout: 60 });
57+
const convertapi = new ConvertAPI('your-api-secret-or-token', { conversionTimeout: 60 });
5858
```
5959

6060
### File conversion

examples/alternative_converter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of saving Word docx to PDF using OpenOffice converter

examples/conversion_chaining.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Short example of conversions chaining, the PDF pages extracted and saved as separated JPGs and then ZIP'ed

examples/convert_base64_content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of using buffer and stream to convert base64 encoded content to pdf

examples/convert_stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
var fs = require('fs');
44

5-
// set your api secret
5+
// set your api secret or token
66
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
77

88
// Example of using readable stream to convert to pdf

examples/convert_url_to_pdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of converting Web Page URL to PDF file

examples/convert_word_to_pdf_and_png.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of saving Word docx to PDF and to PNG

examples/create_pdf_thumbnail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of extracting first page from PDF and then chaining conversion PDF page to JPG.

examples/get_result_file_stream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Example of converting Web Page URL to PDF and reading file data as string

examples/retrieve_user_information.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22

3-
// set your api secret
3+
// set your api secret or token
44
var convertapi = require('../lib')(process.env.CONVERT_API_SECRET);
55

66
// Retrieve user information

0 commit comments

Comments
 (0)