Skip to content
How to conceal the ...
 
Notifications
Clear all

How to conceal the 'Custom API Call' option within a custom node?

3 Posts
2 Users
0 Reactions
4 Views
cesar-airtop
(@cesar-airtop)
Posts: 2
New Member
Topic starter
 

Describe the problem/error/question

I am developing a custom node for Airtop and I need to conceal the "Custom API Call" option that appears within the node operations, as illustrated in the image below:

Credentials

import type {
    IAuthenticateGeneric,
    ICredentialType,
    ICredentialTestRequest,
    INodeProperties,
} from 'n8n-workflow';

export class AirtopApi implements ICredentialType {
    name = 'airtopApi';

    displayName = 'Airtop API';

    documentationUrl = 'airtop';

    properties: INodeProperties[] = [
        {
            displayName: 'API Key',
            name: 'apiKey',
            type: 'string',
            default: '',
            required: true,
            typeOptions: {
                password: true,
            },
            noDataExpression: true,
        },
    ];

    authenticate: IAuthenticateGeneric = {
        type: 'generic',
        properties: {
            headers: {
                Authorization: '=Bearer {{$credentials.apiKey}}',
                'api-key': '={{$credentials.apiKey}}',
            },
        },
    };

    test: ICredentialTestRequest = {
        request: {
            method: 'GET',
            baseURL: 'https://api.airtop.ai/api/v1',
            url: '/sessions',
            qs: {
                limit: 10,
            },
        },
    };
}

Information on your n8n setup

  • n8n version:1.81.0
  • Database (default: SQLite):Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, callin.io cloud, desktop app):Docker
  • Operating system:MacOS
 
Posted : 04/03/2025 9:47 pm
cesar-airtop
(@cesar-airtop)
Posts: 2
New Member
Topic starter
 

When searching through the code, you'll need to either set your node's defaultVersion to not match the node's version.

My node description

export class Airtop implements INodeType {
   description: INodeTypeDescription = {
   ...
   defaultVersion: 1,
   version: [1], // array !== number
    ...
  }
}

packages/cli/src/load-nodes-and-credentials.ts

private injectCustomApiCallOptions() {
    this.types.nodes.forEach((node: INodeTypeDescription) => {

    // Ensure this returns false    
    const isLatestVersion =
            node.defaultVersion === undefined || node.defaultVersion === node.version;

    if (isLatestVersion) {
        if (!this.supportsProxyAuth(node)) return;

                node.properties.forEach((p) => {
                    if (
                        ['resource', 'operation'].includes(p.name) &&
                        Array.isArray(p.options) &&
                        p.options[p.options.length - 1].name !== CUSTOM_API_CALL_NAME
                    ) {
                        p.options.push({
                            name: CUSTOM_API_CALL_NAME,
                            value: CUSTOM_API_CALL_KEY,
                        });
                    }
                });
            }
        });
    }
 
Posted : 04/03/2025 10:34 pm
system
(@system)
Posts: 332
Reputable Member
 

This discussion was automatically closed 7 days following the last response. New replies are no longer permitted.

 
Posted : 11/03/2025 10:34 pm
Share: