GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
User Guide
  • Quick Start

  • Authentication

  • Access Control

  • Authorization

  • Adaptive MFA

  • User Account Management

  • User Directory Management

  • Applications

  • Become a Federation Authentication Identity Provider

  • Connect External Identity Providers (IdP)

  • WeChat Ecosystem Full Scenario Capabilities

  • Migrate Users to GenAuth

  • Security Settings

  • Branding

  • Automation

    • Pipeline

      • Create Your First Pipeline Function
      • Pipeline API Reference
      • Pipeline Use Cases
      • Pipeline User Object
      • Pipeline Context Object
      • Use Environment Variables in Pipeline
      • Available Node Modules
      • How to Debug
      • Private Deployment
    • Webhooks
  • Audit Logs

  • Setting

  • FAQ

  1. User Guide
  2. /
  3. Automation
  4. /
  5. Pipeline
  6. /
  7. Use Environment Variables in Pipeline

¶ Use environment variables in Pipeline

Update time: 2025-07-23 07:34:21
Edit

The concept of environment variables in Pipeline functions is the same as that of environment variables in the operating system. Developers can obtain them through the global variable env. Environment variables are visible to all Pipelien functions in the application pool.

You can configure environment variables on the Settings - Environment variables page:

Environment variables are a set of Key-Value Pair values ​​that can be used to save WebHook links, keys and other data.

Enter the Key and Value and click Add:

Here, we set an environment variable with the Key as LARK_WEBHOOK. In the Pipeline function, we can get the corresponding Value through env.LARK_WEBHOOK. For example, the following example triggers a Feishu group notification after user registration:

async function pipe(user, context, callback) {
  const webhook = env.LARK_WEBHOOK;
  await axios.post(webhook, {
    title:
      "New User Registered - From {{$localeConfig.brandName}} Rules Pipeline",
    text: `
                User information:
                ID: ${user.id}
                Nickname: ${user.username}
                Registration method: ${user.registerSource}
                Email: ${user.email}
                Phone number: ${user.phone}
                UA: ${user.device}
                User pool ID: ${user.userPoolId}
          `,
  });
  return callback(null, user, context);
}
Previous article: Pipeline Context Object Next article: Available Node Modules

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.