# New in developing Nodes

**URL:** <https://discourse.nodered.org/t/new-in-developing-nodes/91045>\
**Category:** Developing Nodes\
**Created:** [17 September 2024 16:00 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045 "2024-09-17T16:00:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [17 September 2024 16:00 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/1 "2024-09-17T16:00:07Z")

</div>

Hi the community,  
I am trying to develop my own nodes (and I am not a dev) when I find exactly what I want in the repository.  
The first one I created is one that allow me toretreive all the events between 2 dates / times from Google Calendar in a specific calendar (some exists, but are old, or I was not able to make them work). It is working well on my environnement, but I have no idea if it is properly done or not. How can I share it to have comments about it ?  
Thanks  
Regards

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [17 September 2024 16:50 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/2 "2024-09-17T16:50:26Z")

</div>

Welcome to the forums @fdecourt

And a thank you for contributing to the project.  
If you have a Github account - upload your project to it, and share its repo link.

---

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [17 September 2024 17:15 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/3 "2024-09-17T17:15:04Z")

</div>

> [@marcus-j-davies](#):
>
> Github

Thanks @marcus-j-davies. Here is the repo link, just uploaded : [GitHub - fdecourt/node-red-contrib-google-calendar-events: Retreiving Calendar events from Google Calendar for NodeRed](https://github.com/fdecourt/node-red-contrib-google-calendar-events)

Needed more work 😉

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [17 September 2024 17:44 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/4 "2024-09-17T17:44:27Z")

</div>

Great! thanks

I dont use google for anything.  
but just a few tips on the code itself.

- Use off `var`  
I would try to switch to `let` - `var` is extremely dated and isn't suggested these days

- Let Node RED do the work for you in the `oneditprepare` and `oneditsave`

- Add `on('close')`  
This is recommended as it allows Node RED to be told when its safe to bring down the Node fully

- Enhance the `input`, to allow `complete` and `catch` nodes to be supported

- Protect your API endpoints

Just some things I spotted (I didn't use a fine toothed comb), overall - Nice work! 😃

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [17 September 2024 18:09 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/5 "2024-09-17T18:09:59Z")

</div>

@fdecourt - Please note the node naming protocol - [Packaging : Node-RED](https://nodered.org/docs/creating-nodes/packaging)

Packages should use a SCoped name - Such as @myScope/node- red-  
sample. That can be under a user SCope or an organisation scope.  
So probably better to change it before it gets published.

You could use something like `@fdecourt/node-red-google-calendar-events` (no need now for the contrib...)

Oh, and don't forget to add the **repository** section to your package, so users will know more about how it works, report issues, or even contribute.

---

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [17 September 2024 23:03 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/6 "2024-09-17T23:03:24Z")

</div>

Thanks @Paul-Reed , I will update it. it is just a very first draft (v0.0.1 ;-)... Just sharing it to have some comment on the direction I took ! it is working, but not clean enough to be used by other, yet.

---

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [17 September 2024 23:05 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/7 "2024-09-17T23:05:57Z")

</div>

Thanks a lot @marcus-j-davies. I will use your advices.

---

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [19 September 2024 11:52 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/8 "2024-09-19T11:52:15Z")

</div>

Ok, I updated the code to, hopefully, make it better ! Is someone is ready to test, it will be nice 😉 🙂

> **[GitHub - fdecourt/node-red-contrib-google-calendar-events: Retreiving Calendar events from Google Calendar...](https://github.com/fdecourt/node-red-contrib-google-calendar-events)**
>
> Retreiving Calendar events from Google Calendar for NodeRed

---

<div class="post-metadata">

**Author:** ![fdecourt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fdecourt/32/85290_2.png) [@fdecourt](https://discourse.nodered.org/u/fdecourt)\
**Post date:** [19 September 2024 19:11 UTC](https://discourse.nodered.org/t/new-in-developing-nodes/91045/9 "2024-09-19T19:11:19Z")

</div>

I have one question. To initiate the connection to Google, I have a configuration node that allows entering the Client ID and Secret Key. The problem is that the first time I want to set it up, I must first input the information (Secret Key and ID), then save, then save the `google-calendar-events` node, then deploy, and finally return to the configuration of the `google-calendar-config` node, where I can start the authentication process. Even though this only needs to be done once, it is not very user-friendly. This likely happens because the nodes are not yet deployed, so the entire mechanism isn't in place. Is there a way to make things cleaner while maintaining a global configuration? Thank you for your help.
