UNPKG

@apidaze/node-red-contrib-apidaze

Version:
33 lines (26 loc) 636 B
module.exports = function (RED) { 'use strict'; const { Apidaze } = require('@apidaze/node'); function ApidazeConfig(config) { RED.nodes.createNode(this, config); const apiKey = this.credentials.apiKey; const apiSecret = this.credentials.apiSecret; if (!apiKey) { this.warn('Missing apiKey!'); } if (!apiKey) { this.warn('Missing apiSecret!'); } this.client = new Apidaze(apiKey, apiSecret); } RED.nodes.registerType('config', ApidazeConfig, { credentials: { apiKey: { type: 'text', }, apiSecret: { type: 'text', }, }, }); };