---
title: "PHP, Python, .NET or Node.js: go live"
description: "The checks before publishing your integration."
url: "/sdk-integration-server-go-live/"
language: "en"
guide: "PHP, Python, .NET, Node.js"
step: "Quickstart step 3 of 3, required"
---

# Go live

Your code doesn’t change: only the keys, the variables and the domain do. Here are just those changes, with your production data.

Every example on this page uses the production values: the production API Key and API Secret and the app’s real domain.

## What changes

### 1. Validate your domain and use the Production keys

In the Dashboard, [validate your domain](/integration-quickstart.md#apps-validate-domain). Then copy the **Production** data with **Copy data for the guide** and paste it into [your data](/sdk-integration.md#setup): it fills in the Production row.

### 2. Put the variables on your server

In production don’t use your computer’s `.env`: set them as environment variables on your server or platform. Generate a new `SESSION_SECRET`, different from the development one.

`APP_URL` in development is the URL where your backend runs: Node.js `http://localhost:4000`, PHP `http://localhost:8080`, Python (Flask) `http://localhost:5000`, Python (FastAPI) `http://localhost:8000`, .NET `http://localhost:5000`.

#### Node.js · development

In a .env next to your backend package.json. Load it with `node --env-file=.env` (Node 20.6+) or the `dotenv` package (`import 'dotenv/config'` at the top of your entry file).

**.env**

```dotenv
APP_URL=http://localhost:4000
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### Node.js · production

Set them in your server or platform (Docker, your hosting…), not in a file you upload with your code.

**Environment variables on your server**

```dotenv
APP_URL=https://your-app.com
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### PHP · development

getenv() doesn't read .env files by itself: set them in your server (`SetEnv` in Apache, `env[]` in PHP-FPM), or load the .env with `vlucas/phpdotenv`.

**.env**

```dotenv
APP_URL=http://localhost:8080
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
```

#### PHP · production

Set them in your server or platform (Docker, your hosting…), not in a file you upload with your code.

**Environment variables on your server**

```dotenv
APP_URL=https://your-app.com
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
```

#### Python (Flask) · development

In a .env in your backend folder. `flask run` loads it if `python-dotenv` is installed; with `python app.py`, gunicorn or waitress, call `load_dotenv()` first, use `uv run --env-file .env …` or export the variables.

**.env**

```dotenv
APP_URL=http://localhost:5000
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### Python (Flask) · production

Set them in your server or platform (Docker, your hosting…), not in a file you upload with your code.

**Environment variables on your server**

```dotenv
APP_URL=https://your-app.com
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### Python (FastAPI) · development

In a .env in your backend folder. Start uvicorn with `--env-file .env` (needs `python-dotenv` installed) or, with uv, `uv run --env-file .env uvicorn …`, or export the variables.

**.env**

```dotenv
APP_URL=http://localhost:8000
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### Python (FastAPI) · production

Set them in your server or platform (Docker, your hosting…), not in a file you upload with your code.

**Environment variables on your server**

```dotenv
APP_URL=https://your-app.com
BLOCKAUTH_API_KEY=your_api_key
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
SESSION_SECRET=<generate one: openssl rand -hex 32>
```

#### .NET · development

The public values go in `appsettings.json`. The secret never goes in a file you commit: in development use `user-secrets`, in production an environment variable.

**appsettings.json**

```json
{
  "APP_URL": "http://localhost:5000",
  "BLOCKAUTH_API_KEY": "your_api_key"
}
```

**Terminal, in the project folder (development only)**

```bash
dotnet user-secrets init
dotnet user-secrets set "BLOCKAUTH_API_SECRET" "<paste the API Secret from the Dashboard>"
```

#### .NET · production

Set them in your server or platform (Docker, your hosting…), not in a file you upload with your code.

**appsettings.json**

```json
{
  "APP_URL": "https://your-app.com",
  "BLOCKAUTH_API_KEY": "your_api_key"
}
```

**Environment variable on your server (never in a repo file)**

```dotenv
BLOCKAUTH_API_SECRET=<paste the API Secret from the Dashboard>
```

> **Placeholders in this code:**
>
> - Replace the API Secret placeholder with your API Secret, copied straight from the Dashboard. Never paste it on this site.
> - Replace the SESSION\_SECRET placeholder with a random value generated on your computer: `openssl rand -hex 32`.
> - Replace `your_api_key` with your API Key, or fill in your data in the SDK Quickstart and it is filled in for you.
> - Replace `https://your-app.com` with your app URL, or fill in your data in the SDK Quickstart and it is filled in for you.

### 3. Use your domain over `https`

`APP_URL` is your validated domain on `https`, so the callback becomes `https://your-app.com/blockauth/callback` and the session cookie is marked secure. If a proxy terminates `https` in front of your server, tell your framework to trust it (in Express, `app.set('trust proxy', 1)`).

### 4. Check the webhook, if you use it

In your production app in the Dashboard, the [webhook](/sdk-integration-server-webhooks.md) path is the same, `/blockauth/webhook`, on your public domain.

### 5. Try it

Open `https://your-app.com/blockauth/login`, sign in and check that you come back signed in.

## Before you publish

Go over this before opening your app to your users:

- Your production app has its own validated domain and keys, and the site uses `https`.
- The `apiSecret` is only in your server's environment.
- The callback always checks the `state`, and your app creates sessions only from the address returned by `/api/auth/token`.
- The session cookie is `HttpOnly`, `Secure` and `SameSite=Lax`.

**With this, the integration is done.** What follows under **More options** is optional: add it when your app needs it.

This is the last required step of the guide. What follows under More options is optional.
