# Node.js SDK - authentication accesKeyOrToken

**URL:** <https://www.thethingsnetwork.org/forum/t/node-js-sdk-authentication-acceskeyortoken/27299>\
**Category:** Application Development\
**Created:** [June 19, 2019, 3:22pm UTC](https://www.thethingsnetwork.org/forum/t/node-js-sdk-authentication-acceskeyortoken/27299 "2019-06-19T15:22:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoramigTest](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loramigtest/32/25844_2.png) [@LoramigTest](https://www.thethingsnetwork.org/forum/u/LoramigTest)\
**Post date:** [June 19, 2019, 3:22pm UTC](https://www.thethingsnetwork.org/forum/t/node-js-sdk-authentication-acceskeyortoken/27299/1 "2019-06-19T15:22:10Z")

</div>

Hi,  
where I can find accesKeyOrToken to use AccountClient from node.js sdk. I thought that it’s access keys from application section on TTN, but it doesn’t work - “401 unauthorized”.  
Basic case in NodeJS:

> const { account } = require(‘ttn’);  
> const { accessKey } = require(‘./config’);  
> const AccountClient = new account(accessKey);
> 
> const getApp = async () =\> {  
> try {  
> const app = await AccountClient.getApplication();  
> }  
> catch (err) {  
> console.log(new Error(err));  
> }  
> }

getApp();

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [August 18, 2019, 3:22pm UTC](https://www.thethingsnetwork.org/forum/t/node-js-sdk-authentication-acceskeyortoken/27299/2 "2019-08-18T15:22:13Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
