Hi N8N Team,
After integrating n8n in our product , we need to remove the credentials dropdown from custom node and we are trying to pass authentication token from frontend session storage to n8n custom node , for that we are declaring the below code in our custom node
declare global {
var jwtToken: any ;
}
let jwtToken = sessionStorage.getItem('token')
but we are getting error like “”“Error: There was an error: sessionStorage is not defined”“”
can you give any example of how to solve this issue
Hi @praveen,
a browser’s sessionStorage cannot be accessed from your custom node, because your node executions are not running in the browser but inside the nodejs backend of n8n. Generally everything happening in the browser frontend is decoupled from nodes being executed in the backend.
You could use Env options or hard code the values in the nodes, If it needed to be more dynamic maybe your custom node could query a database to get the values it needs.