Need to replace credentials dropdown in my custom node, after integrating N8N into my product?

Hi N8N Team,
I need to remove credentials dropdown in my custom node, after integrating N8N into my product. so that the user doesn’t want to give the same credentials two times(fist-login into the product, second-giving credentials in N8N).I need the credentials to come dynamically to the N8N,once the login is made in my product. Shall you give me any example of how to achieve this?
Thanks and regards
Praveen

Hey @praveen,
the first step would be to import the credentials. Right now the best option to do this is our cli import command.

n8n import:credentials --input=credentials.json

I created an example credentials.json file to import github credentials:

[
	{
		"id": 1,
		"type": "githubApi",
		"name": "Joe's Github Credentials",
		"data": {
			"server": "https://api.github.com",
			"user": "mygithubuser",
			"accessToken": "ada612vad6fa5df4adf5a5dsf4389adsf76da7s"
		},
		"nodesAccess": [
			{
				"nodeType": "n8n-nodes-base.githubTrigger"
			},
			{
				"nodeType": "n8n-nodes-base.github"
			}
		]
	}
]

If you run the import command again, all credentials with the same id will be updated.

To see what your credentials file has to look like it’s best to create them in n8n and than export them like this:

n8n export:credentials --all --decrypted --output=credentials.json
1 Like

If you want to customize the behavior of our node credentials dropdown you should checkout these two vue components