Skip to content

Commit 34eb3cd

Browse files
authored
feat: add credentials test to validate credentials configuration in n8n (#20)
* chore: specify json schema in tsconfig for IDE intelli sense suport * feat: add credentials test to validate credentials configuration in n8n
1 parent bb4af8a commit 34eb3cd

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

credentials/TwitchApi.credentials.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
ICredentialTestRequest,
23
ICredentialType,
34
INodeProperties,
45
} from 'n8n-workflow';
@@ -22,4 +23,20 @@ export class TwitchApi implements ICredentialType {
2223
default: '',
2324
},
2425
];
26+
27+
test: ICredentialTestRequest = {
28+
request: {
29+
baseURL: 'https://id.twitch.tv',
30+
url: '/oauth2/token',
31+
method: 'POST',
32+
headers: {
33+
'Content-Type': 'application/json',
34+
},
35+
qs: {
36+
client_id: '={{$credentials.clientId}}',
37+
client_secret: '={{$credentials.clientSecret}}',
38+
grant_type: 'client_credentials',
39+
},
40+
},
41+
};
2542
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
23
"compilerOptions": {
34
"strict": true,
45
"module": "es2020",

0 commit comments

Comments
 (0)