Function Store
  • Home
  • Getting started
    • Introduction
    • Installing a function
    • Reconfiguring a function
    • Uninstalling a function
    • FAQs
  • Reference
    • Requirements
      • Assign Roles
        • User permissions
      • Link a Billing account to your project
      • Enable the APIs
    • Projects
      • How to add a project
      • How to set up a project
    • Functions
      • Benefits
      • Use cases
      • Authentication when installing
      • Runtime configuration
      • Deploying with a ZIP file
    • Policies
      • How to add a Policy
      • How to remove a Policy
    • Authentication
      • Users
      • Roles
      • Permissions
    • Secrets
      • Creating a Secret
      • Using a Secret
      • Changing the value for a Secret
      • Deactivating a Secret
  • developers
    • Overview
    • Getting Started
    • Set up
    • Workspaces
      • Create a workspace
      • Workspace boilerplate
      • Node engines
    • Writing Functions
      • Function Anatomy
      • Configuration file
      • Function Triggers
      • Environment Variables
        • Type "text"
        • Type "number"
        • Type "email"
        • Type "url"
        • Type "json"
        • Type "boolean"
        • Type "select"
        • Type "multiselect"
        • Type "firestoreDocumentPath"
        • Type "firestoreCollectionPath"
        • Type "color"
      • Documentation
    • Push/Update your functions in the cloud
    • Continuous Integration
    • Publish functions in the Marketplace
    • Emulators
      • Initialize emulators in your workspace
      • Environment variables
      • Starting emulators
      • Testing your functions in the emulator
      • Importing existing data into local emulators
        • Exporting data from Cloud Firestore to local emulator
        • Exporting user accounts from Firebase to local emulator
    • Visual Studio Code Extension
      • Installing the extension
      • Extension UI
      • Functions list
      • Creating and editing functions
      • Emulators
      • Extension settings
      • Troubleshooting
        • "Command not found" error when executing a command
  • Billing
    • Understanding Billing
  • Security
    • Security
  • Resources
    • Events and Triggers
    • Best Practices
      • How to log events in functions?
    • Document your Functions
    • Editorial guidelines
    • Our Processes
      • Use Cases Analysis
  • Use cases
    • Custom Stripe Checkout
Powered by GitBook
On this page

Was this helpful?

  1. developers

Writing Functions

Build the Cloud Functions by writing JavaScript code.

PreviousNode enginesNextFunction Anatomy

Last updated 3 years ago

Was this helpful?

There is a list of things you need to know about writing Cloud Functions using our boilerplate.

  1. You can write your function in JavaScript.

  2. Functions implementation lives inside of /functions directory, e.g., /functions/hellowWorld.

  3. Every function is an independent Node.js module with its own dependencies.

  4. The entry point of every function is always the main.js file, e.g., /functions/helloWorld/main.js.

  5. Every function needs a configuration file with metadata about the function.

You can also build your functions by writing "TypeScript" as long as you push a build code that contains the main.js file at the root of each function.

What do you need to know about writing functions?

  1. understand the function folder structure.

  2. implement the configuration of your function.

  3. define the trigger of your function.

  4. define the environment variables of your function.

  5. explain how your function works.

You can check the workspace example on GitHub to see how functions are created.

Function Anatomy:
Configuration file:
Function Triggers:
Environment Variables:
Documentation:
https://github.com/nexxtway/functions.store-learning