--- title: "Node Considerations" url: https://docs.catalyst.zoho.com/en/sdk/javascript/v1/auth-config/node-consideration/ description: "Catalyst offers you JavaScript SDK in a modular architecture, providing you with a singular SDK for browser and server operations." last_updated: 2026-09-09T10:45:38Z service: All Services type: general related_links: - name: "Java SDK" url: /en/sdk/java/v1/overview/ - name: "Python SDK" url: /en/sdk/python/v1/overview/ - name: "iOS SDK" url: /en/sdk/ios/v2/overview/ - name: "Android SDK" url: /en/sdk/android/v2/overview/ - name: "Flutter SDK" url: /en/sdk/flutter/v2/overview/ - name: "REST APIs" url: /en/api/code-reference/general/projects/create-new-project/#CreateNewProject - name: "Catalyst Functions" url: /en/serverless/help/functions/introduction repository: name: "Repository" url: https://github.com/catalystbyzoho/zcatalyst-sdk-js --- # Authentication Configuration for Node To use the JavaScript SDK methods for server or node operations, you need to fulfill the following prerequisites to ensure the methods are accessed in an authenticated manner: #### Install Requirement ```sh npm install @zcatalyst/auth ``` #### Import Requirement ```javascript import {zcAuth} from '@zcatalyst/auth'; ``` ### Initialize the SDK Once the above prerequisites are fulfilled, you can initialize the Catalyst JavaScript SDK in Catalyst functions in the following manner: **Advanced I/O Function** **Basic Template** ```javascript const { zcAuth }= require('@zcatalyst/auth'); module.exports = (req, res) => { const app = await zcAuth.init(req); //This app variable is used to access the catalyst components. //You can refer the SDK docs for code samples. //Your business logic comes here } ``` **Express.js** ```javascript const { zcAuth }= require('@zcatalyst/auth'); const express = require('express'); const expressApp = express(); expressApp.get('/',(req,res)=> { const app = await zcAuth.init(req); //This app variable is used to access the catalyst components. //You can refer the SDK docs for code samples. //Your business logic comes here }); module.exports=expressApp; ``` **Basic I/O Function** ```javascript const { zcAuth }= require('@zcatalyst/auth'); module.exports = (context, basicIO) => { const app = await zcAuth.init(context); //This app variable is used to access the catalyst components. //You can refer the SDK docs for code samples. //Your business logic comes here } ``` **Event Functions** ```javascript const { zcAuth }= require('@zcatalyst/auth'); module.exports = (event, context) => { const app = await zcAuth.init(context); //This app variable is used to access the catalyst components. //You can refer the SDK docs for code samples. //Your business logic comes here } ``` **Job Function** ```javascript const { zcAuth }= require('@zcatalyst/auth'); module.exports = (cronDetails, context) => { const app = await zcAuth.init(context); //This app variable is used to access the catalyst components. //You can refer the SDK docs for code samples. //Your business logic comes here } ``` ### Initialize with Scopes Catalyst allows you to initialize the SDK in a project using the following scopes: * **Admin**: You have unrestricted access to all the components and their respective functionalities. * **User**: You can restrict access to components and specific functionalities. > **Notes:** * It is not mandatory for you to initialize the projects with scopes. By default, a project that is initialized will have **Admin** privileges. * Ensure you have initialized the Catalyst SDK with the appropriate scope while you engineer your business logic. The permissions you define for your scope control your end-user’s actions. * Depending on how you engineer your business logic, you can decide if your end-users can perform Admin or User actions. This is decided based on the role assigned to your end-user when they sign up to your application in Catalyst Authentication. * [Learn more about the scopes of the SDK operations](https://docs.catalyst.zoho.com/en/sdk/javascript/v1/scopes/). The SDK snippets below will allow you to initialize the SDK using either **Admin** or **User** scope, and use the authentication required to use the Catalyst components: **Admin** You need to initialize the SDK in the following manner to use the SDK methods using **Admin** scope. ```javascript const app = await zcAuth.init(req, {scope: 'admin'}); ``` **User** You need to initialize the SDK in the following manner to use the SDK methods using **User** scope. ```javascript const app = await zcAuth.init(req, {scope: 'user'}); ``` ### Initialize the SDK Using Custom Credentials To use the SDK with third-party authentication services, you can initialize the SDK in the following manner: ```javascript const credential = { "client_id":"xxxxxxxxxx", "client_secret": "yyyyyyyyyyy", "refresh_token": "sgdw6et6736e8723e" } const customConfigurations = { "project_id": "46386458237492", "project_domain": "project-domain", "environment": "development", // optional. default: development credential } const app = await zcAuth.init(customConfigurations, { type: 'custom', appName: "custom-app" }); ``` #### Get Instance Using Application Name Once you've initialized your application, you have the additional option to use the `getApp()` method to get an app instance at any point by using the application's name. ```javascript const app = zcAuth.getApp("app-name"); ``` This ensures you are able to get an instance without having to re-initialize your SDK. #### Using Environment Variables You also have the option of initializing the SDK by setting custom credentials as [environment variables](https://docs.catalyst.zoho.com/en/serverless/help/functions/implementation/#environmental-variables). If you choose to initialize the SDK in this manner, then you do not have to initialize using the `zcAuth.init()` method, and you do not have to maintain the `app` instance in the manner shown in the above example snippet. You need to configure the environment variables in a manner similar to the one shown below: ```javascript ZC_SDK_PROJECT_ID="your_project_id" ZC_SDK_PROJECT_KEY="your_project_key" ZC_SDK_PROJECT_DOMAIN="your_project_domain" ZC_SDK_ENVIRONMENT="your_environment" ZC_SDK_CLIENT_ID="your_client_id" ZC_SDK_CLIENT_SECRET="your_client_secret" ZC_SDK_REFRESH_TOKEN="your_refresh_token" ```