Skip to content

Commit

Permalink
feat(ios): add origin sdk field support
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo committed Jul 5, 2022
1 parent 5bd4b1c commit 6dad500
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['14', '15']
node: ['15']
steps:
- uses: actions/checkout@v2
- name: Setup node ${{ matrix.node }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [2.2.8] - 2022-07-05
- Add SDK origin header

## [2.2.7] - 2022-05-06
- Upload methods (except for videos upload) now accept Readable and Buffer in addition to the file path.

Expand Down
172 changes: 86 additions & 86 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@api.video/nodejs-client",
"version": "2.2.7",
"version": "2.2.8",
"description": "api.video nodejs API client",
"keywords": [
"api.video",
Expand Down
15 changes: 10 additions & 5 deletions src/HttpClient.ts
Expand Up @@ -39,19 +39,24 @@ export default class HttpClient {
chunkSize: number;
applicationName?: string;
applicationVersion?: string;
sdkName?: string;
sdkVersion?: string;
}) {
this.apiKey = params.apiKey;
this.baseUri = params.baseUri;
this.chunkSize = params.chunkSize;
this.tokenType = 'Bearer';
this.headers = {
Accept: 'application/json, */*;q=0.8',
'AV-Origin-Client': 'nodejs:2.2.7',
...(params.applicationName
'AV-Origin-Client': 'nodejs:2.2.8',
...(params.applicationName && params.applicationVersion
? {
'AV-Origin-App': `${params.applicationName}${
params.applicationVersion ? ':' + params.applicationVersion : ''
}`,
'AV-Origin-App': `${params.applicationName}:${params.applicationVersion}`,
}
: {}),
...(params.sdkName && params.sdkVersion
? {
'AV-Origin-Sdk': `${params.sdkName}:${params.sdkVersion}`,
}
: {}),
};
Expand Down

0 comments on commit 6dad500

Please sign in to comment.