n8n/packages/nodes-base/credentials/HubspotApi.credentials.ts

32 lines
651 B
TypeScript

import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
export class HubspotApi implements ICredentialType {
name = 'hubspotApi';
displayName = 'HubSpot API';
documentationUrl = 'hubspot';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
qs: {
hapikey: '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.hubapi.com',
url: '/account-info/v3/details',
},
};
}