Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360707
ExampleCredentialsApi.credentials.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ExampleCredentialsApi.credentials.ts
View Options
import
{
IAuthenticateGeneric
,
ICredentialTestRequest
,
ICredentialType
,
INodeProperties
,
}
from
'n8n-workflow'
;
export
class
ExampleCredentialsApi
implements
ICredentialType
{
name
=
'exampleCredentialsApi'
;
displayName
=
'Example Credentials API'
;
properties
:
INodeProperties
[]
=
[
// The credentials to get from user and save encrypted.
// Properties can be defined exactly in the same way
// as node properties.
{
displayName
:
'User Name'
,
name
:
'username'
,
type
:
'string'
,
default
:
''
,
},
{
displayName
:
'Password'
,
name
:
'password'
,
type
:
'string'
,
typeOptions
:
{
password
:
true
,
},
default
:
''
,
},
];
// This credential is currently not used by any node directly
// but the HTTP Request node can use it to make requests.
// The credential is also testable due to the `test` property below
authenticate
:
IAuthenticateGeneric
=
{
type
:
'generic'
,
properties
:
{
auth
:
{
username
:
'={{ $credentials.username }}'
,
password
:
'={{ $credentials.password }}'
,
},
qs
:
{
// Send this as part of the query string
n8n
:
'rocks'
,
},
},
};
// The block below tells how this credential can be tested
test
:
ICredentialTestRequest
=
{
request
:
{
baseURL
:
'https://example.com/'
,
url
:
''
,
},
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 8, 08:23 (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1033607
Default Alt Text
ExampleCredentialsApi.credentials.ts (1 KB)
Attached To
Mode
rNPN n8n-phabricator-node
Attached
Detach File
Event Timeline
Log In to Comment