Setup a Defer application

A Defer application is necessary to trigger background function executions from your application.

 

 

Setup a new application

First, sign-in to the Defer Dashboard:

On the create application form, make sure to install Defer on your GitHub account or organization so Defer can list your repositories.

Install Defer on your GitHub account

Then, select the GitHub repository of your application:

Select a GitHub repository

 

 

 

Environment variables

The background functions that run in Defer might need to access some externally configured services or databases. For this reason, we recommend using the same environment variables configuration for your target API environment and Defer application:

Tips

Got a .env file? Copy the content of the file into your clipboard and paste it into the first field of the "Add" line. ✨

 

 

 

Monorepo, Prisma

If your application resides in a monorepo or relies on Prisma, please refer to the Builds page on advanced options.

Pre-build command

 

 

Once your application is properly configured, click the “Create” button.

Once redirected to the application, you should now get a Defer Token as follows:

Copy your Defer token

 

 

Setup a new environment

Defer allows each application to have multiple environments.

Each environment is tied to a GitHub branch, making it easy to test new features before moving to production.

First, sign-in to the Defer Dashboard:

To create a new environment, go to the Defer Dashboard's home and, on an application card, open the actions menu:

Create a new environment

You will land on the application form with the application's repository preselected:

New environment form

Provide a valid branch name and environment name.

 

 

 

Environment variables

The background functions that run in Defer might need to access some externally configured services or databases. For this reason, we recommend using the same environment variables configuration for your target API environment and Defer application:

Tips

Got a .env file? Copy the content of the file into your clipboard and paste it into the first field of the "Add" line. ✨

 

 

 

Monorepo, Prisma

If your application resides in a monorepo or relies on Prisma, please refer to the Builds page on advanced options.

 

 

Once your application is properly configured, click the “Create” button.

Once redirected to the application, you should now get a Defer Token as follows:

Copy your Defer token