Files
mem0/integrations/n8n-nodes-mem0/credentials/Mem0Api.credentials.ts
T
Himanshu-Sangshetti 4473b0da64 fix(n8n): distinct light/dark icon files (0.1.4)
0.1.3 failed vetting on @n8n/community-nodes/icon-validation: light and dark
icon variants must be DIFFERENT files, but both pointed at mem0.svg. Add a
distinct light-theme variant (mem0-light.svg, brand purple #8F74E0 — the
existing mem0.svg is white and only reads on dark backgrounds) and wire
icon = { light: 'file:mem0-light.svg', dark: 'file:mem0.svg' } on both the
node and the credential. Verified locally: both icon-validation and
icon-prefer-themed-variants pass (0 problems). Matches the verified
@probo/n8n-nodes-probo pattern (probo-light.svg + probo.svg).
2026-08-06 00:14:41 +05:30

57 lines
1.3 KiB
TypeScript

import {
IAuthenticateGeneric,
Icon,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class Mem0Api implements ICredentialType {
name = 'mem0Api';
displayName = 'Mem0 API';
icon: Icon = { light: 'file:mem0-light.svg', dark: 'file:mem0.svg' };
documentationUrl = 'https://docs.mem0.ai/platform/quickstart';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
required: true,
description: 'Your Mem0 API key (starts with "m0-"). Create one at app.mem0.ai → Settings → API Keys.',
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: 'https://api.mem0.ai',
description: 'Mem0 API base URL. Override only for self-hosted or non-default deployments.',
},
];
// Injects "Authorization: Token <apiKey>" on every request, matching the
// scheme used by Mem0's official SDKs (Authorization: Token m0-...).
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Token {{$credentials.apiKey}}',
},
},
};
// Cheap authenticated GET; validates the key when the user clicks "Test".
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/v1/ping/',
method: 'GET',
},
};
}