Serverless logo
Products
FRAMEWORK
Overview
Monitoring
CI/CD
Secrets
Plugins
CLOUD
Overview
Pricing
FAQ
Signup
CONSOLE
Overview
Company
ABOUT US
About
Careers
Contact Us
SUPPORT
Get Support
COMMUNITY
Slack
Forum
Partners
Meetups
LEARN
Blog
Examples
Guides
Serverless Cloud logoDocsPricingFAQ
Serverless Cloud Dashboard
Serverless Cloud logo
Serverless Cloud Dashboard
DocumentationPricingFAQ
Serverless logo
Serverless Cloud - Docs

Serverless Cloud – Documentation

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Item title

Item description

X
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Item title

Item description

Serverless logo
Product
Expand
Option 1Option 2Option 3
DocsPricing
Company
Expand

Feature 1

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 2

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 3

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 4

Lorem ipsum dolor emet sin dor lorem ipsum
Search
Sales & Support
LoginSign Up
Open MenuClose Menu
Login / Sign Up
Go to Github
Serverless Cloud - Build full stack apps better and faster than everyone else | Product Hunt
Home
How it Works
Development Workflows
Building Applications
Link 1Link 1Link 1
Building Applications
Link 1Link 1Link 1
Building Applications
Link 1Link 1Link 1
Automated Testing
CLI Reference

Parameters

Serverless Cloud allows developers to define parameters (a.k.a. secrets) and pass those parameters to the Serverless Cloud apps in runtime. All the parameters are encrypted both at transit and at rest and can only be decrypted by your application.

Parameter Scopes

For software organizations, some parameters are organization-wide while some of them are specific to an application. Besides, an application will probably use a different value of a parameter for production and for dev environments. To achieve all of this effortlessly, there are three different scopes for the parameters on Serverless Cloud.

Organization-level parameters are defined under Organization Settings in Serverless Cloud Dashboard. Every app and every instance of the organization will inherit those parameters automatically. Organization-level parameters can be overridden in the app and instance level. For example; you might have a key for the shared MongoDB instance of all apps. You can define the access token to MongoDB organization-wide and you can override this parameter for the production instances.

App-level parameters are defined under App Settings for each application. This is useful when you need to define a secret that needs to be used by all instances of a single app. For example; you can define the STRIPE_KEY for all instances of the billing app and they will be good to go. Note that you can add a friendly name and description for your parameters. Those are useful when you make your application public or forkable.

Screen Shot 2021-11-26 at 3 26 35 PM

You can also override the organization-level params here if you need it.

Screen Shot 2021-11-26 at 3 40 21 PM

Instance-level parameters are the summation of org-level parameters and app-level parameters. Instance-level parameters can be regarded as the environment variables passed into your application. You can always override the params inherited at an instance level after defining them at the org/app level. Most common use case is to override the parameters that are only used for production instances.

Note that when you edit a parameter value in Serverless Cloud Dashboard, all the changes will be applied to all running instances that use the parameter. You don't need to restart the applicaiton to flush the values.

Reserved Parameters

Serverless Cloud reserves some of the parameter keys that are automatically populated by our runtime engine. The following parameters below are already used by Serverless Cloud and developers are prevented to pick these as the key.

KEY Value
ORG_NAME The organization that application belongs to
APP_NAME The name of the application
INSTANCE_NAME The name of the instance that application runs on
CLOUD_URL The URL of the application generated by Serverless Cloud

Reading parameters programmatically

Developers can access the params injected to the runtime by using the param interface. Note that Serverless Cloud allows only reading the parameters programmatically. To make change on any parameter, visit Serverless Cloud Dashboard.

const { api, params } = require("@serverless/cloud");

// your params are available at params.KEY
api.get("/", (req, res) => {
  console.log(params.KEY);

  // reading reserved parameters is same as reading the custom parameters
  console.log(params.CLOUD_URL);
});
Edit this page
Serverless logo
Product
Expand
Option 1Option 2Option 3
DocsPricing
Company
Expand

Feature 1

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 2

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 3

Lorem ipsum dolor emet sin dor lorem ipsum

Feature 4

Lorem ipsum dolor emet sin dor lorem ipsum
Search
Sales & Support
LoginSign Up
Open MenuClose Menu
FRAMEWORK
Overview
Monitoring
CI/CD
Secrets
Plugins
CONSOLE
Overview
CLOUD
Overview
FAQ
Signup
RESOURCES
Cloud DocsFramework DocsGuidesExamplesBlog
COMMUNITY
SlackMeetupsForum
SUPPORT
Contact UsPremium Support
COMPANY
AboutCareersPartners
Join our monthly newsletter
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
© 2022 Serverless, Inc. All rights reserved.
Terms of ServicePrivacy Policy