diff --git a/credentials/WizPixelFlowApi.credentials.ts b/credentials/WizPixelFlowApi.credentials.ts new file mode 100644 index 0000000..1d1dbff --- /dev/null +++ b/credentials/WizPixelFlowApi.credentials.ts @@ -0,0 +1,47 @@ +import { + IAuthenticateGeneric, + ICredentialTestRequest, + ICredentialType, + INodeProperties, +} from 'n8n-workflow'; + +export class WizPixelFlowApi implements ICredentialType { + name = 'wizPixelFlowApi'; + displayName = 'WizPixel Flow API'; + documentationUrl = 'https://flow.wizpixel.com/docs/api'; + + properties: INodeProperties[] = [ + { + displayName: 'API Key', + name: 'apiKey', + type: 'string', + typeOptions: { password: true }, + default: '', + required: true, + description: 'Your WizPixel Flow API key. Generate one in your account settings.', + }, + { + displayName: 'API Base URL', + name: 'baseUrl', + type: 'string', + default: 'https://api.wizpixel.com/v1', + required: true, + }, + ]; + + authenticate: IAuthenticateGeneric = { + type: 'generic', + properties: { + headers: { + 'X-WPF-API-Key': '={{$credentials.apiKey}}', + }, + }, + }; + + test: ICredentialTestRequest = { + request: { + baseURL: '={{$credentials.baseUrl}}', + url: '/account', + }, + }; +}